/* Include files */

#include "kalman4_sfun.h"
#include "c2_kalman4.h"
#include "mwmathutil.h"
#define CHARTINSTANCE_CHARTNUMBER      (chartInstance.chartNumber)
#define CHARTINSTANCE_INSTANCENUMBER   (chartInstance.instanceNumber)
#include "kalman4_sfun_debug_macros.h"

/* Type Definitions */

/* Named Constants */
#define c2_IN_NO_ACTIVE_CHILD          (0)

/* Variable Declarations */

/* Variable Definitions */
static SFc2_kalman4InstanceStruct chartInstance;

/* Function Declarations */
static void initialize_c2_kalman4(void);
static void initialize_params_c2_kalman4(void);
static void enable_c2_kalman4(void);
static void disable_c2_kalman4(void);
static void update_debugger_state_c2_kalman4(void);
static const mxArray *get_sim_state_c2_kalman4(void);
static void set_sim_state_c2_kalman4(const mxArray *c2_st);
static void finalize_c2_kalman4(void);
static void sf_c2_kalman4(void);
static void c2_c2_kalman4(void);
static void init_script_number_translation(uint32_T c2_machineNumber, uint32_T
  c2_chartNumber);
static real_T c2_mpower(real_T c2_a);
static const mxArray *c2_sf_marshall(void *c2_chartInstance, void *c2_u);
static const mxArray *c2_b_sf_marshall(void *c2_chartInstance, void *c2_u);
static const mxArray *c2_c_sf_marshall(void *c2_chartInstance, void *c2_u);
static const mxArray *c2_d_sf_marshall(void *c2_chartInstance, void *c2_u);
static const mxArray *c2_e_sf_marshall(void *c2_chartInstance, void *c2_u);
static const mxArray *c2_f_sf_marshall(void *c2_chartInstance, void *c2_u);
static const mxArray *c2_g_sf_marshall(void *c2_chartInstance, void *c2_u);
static void c2_info_helper(c2_ResolvedFunctionInfo c2_info[70]);
static void init_dsm_address_info(void);

/* Function Definitions */
static void initialize_c2_kalman4(void)
{
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
  chartInstance.c2_is_active_c2_kalman4 = 0U;
}

static void initialize_params_c2_kalman4(void)
{
}

static void enable_c2_kalman4(void)
{
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
}

static void disable_c2_kalman4(void)
{
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
}

static void update_debugger_state_c2_kalman4(void)
{
}

static const mxArray *get_sim_state_c2_kalman4(void)
{
  return NULL;
}

static void set_sim_state_c2_kalman4(const mxArray *c2_st)
{
  sf_mex_destroy(&c2_st);
}

static void finalize_c2_kalman4(void)
{
}

static void sf_c2_kalman4(void)
{
  int32_T c2_i0;
  int32_T c2_i1;
  int32_T c2_i2;
  int32_T c2_i3;
  int32_T c2_i4;
  int32_T c2_i5;
  int32_T c2_i6;
  int32_T c2_i7;
  int32_T c2_i8;
  int32_T c2_i9;
  uint8_T c2_previousEvent;
  real_T *c2_u;
  real_T *c2_D;
  real_T *c2_R;
  real_T *c2_y;
  real_T (*c2_Pkplus1)[9];
  real_T (*c2_Pk)[9];
  real_T (*c2_xk)[3];
  real_T (*c2_Q)[4];
  real_T (*c2_H)[2];
  real_T (*c2_C)[3];
  real_T (*c2_G)[6];
  real_T (*c2_Gamma)[3];
  real_T (*c2_Phi)[9];
  real_T (*c2_xkplus1)[3];
  c2_H = (real_T (*)[2])ssGetInputPortSignal(chartInstance.S, 6);
  c2_xkplus1 = (real_T (*)[3])ssGetOutputPortSignal(chartInstance.S, 1);
  c2_Q = (real_T (*)[4])ssGetInputPortSignal(chartInstance.S, 7);
  c2_D = (real_T *)ssGetInputPortSignal(chartInstance.S, 5);
  c2_y = (real_T *)ssGetInputPortSignal(chartInstance.S, 11);
  c2_Phi = (real_T (*)[9])ssGetInputPortSignal(chartInstance.S, 1);
  c2_u = (real_T *)ssGetInputPortSignal(chartInstance.S, 0);
  c2_G = (real_T (*)[6])ssGetInputPortSignal(chartInstance.S, 3);
  c2_xk = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 9);
  c2_Pk = (real_T (*)[9])ssGetInputPortSignal(chartInstance.S, 10);
  c2_Gamma = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 2);
  c2_R = (real_T *)ssGetInputPortSignal(chartInstance.S, 8);
  c2_C = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 4);
  c2_Pkplus1 = (real_T (*)[9])ssGetOutputPortSignal(chartInstance.S, 2);
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG,0);
  _SFD_DATA_RANGE_CHECK(*c2_u, 0U);
  for (c2_i0 = 0; c2_i0 < 3; c2_i0 = c2_i0 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_xkplus1)[c2_i0], 1U);
  }

  for (c2_i1 = 0; c2_i1 < 9; c2_i1 = c2_i1 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_Phi)[c2_i1], 2U);
  }

  for (c2_i2 = 0; c2_i2 < 3; c2_i2 = c2_i2 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_Gamma)[c2_i2], 3U);
  }

  for (c2_i3 = 0; c2_i3 < 6; c2_i3 = c2_i3 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_G)[c2_i3], 4U);
  }

  for (c2_i4 = 0; c2_i4 < 3; c2_i4 = c2_i4 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_C)[c2_i4], 5U);
  }

  _SFD_DATA_RANGE_CHECK(*c2_D, 6U);
  for (c2_i5 = 0; c2_i5 < 2; c2_i5 = c2_i5 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_H)[c2_i5], 7U);
  }

  for (c2_i6 = 0; c2_i6 < 4; c2_i6 = c2_i6 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_Q)[c2_i6], 8U);
  }

  _SFD_DATA_RANGE_CHECK(*c2_R, 9U);
  for (c2_i7 = 0; c2_i7 < 3; c2_i7 = c2_i7 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_xk)[c2_i7], 10U);
  }

  for (c2_i8 = 0; c2_i8 < 9; c2_i8 = c2_i8 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_Pk)[c2_i8], 11U);
  }

  for (c2_i9 = 0; c2_i9 < 9; c2_i9 = c2_i9 + 1) {
    _SFD_DATA_RANGE_CHECK((*c2_Pkplus1)[c2_i9], 12U);
  }

  _SFD_DATA_RANGE_CHECK(*c2_y, 13U);
  c2_previousEvent = _sfEvent_;
  _sfEvent_ = CALL_EVENT;
  c2_c2_kalman4();
  _sfEvent_ = c2_previousEvent;
  sf_debug_check_for_state_inconsistency(_kalman4MachineNumber_,
    chartInstance.chartNumber, chartInstance.instanceNumber);
}

static void c2_c2_kalman4(void)
{
  real_T c2_u;
  int32_T c2_i10;
  real_T c2_Phi[9];
  int32_T c2_i11;
  real_T c2_Gamma[3];
  int32_T c2_i12;
  real_T c2_G[6];
  int32_T c2_i13;
  real_T c2_C[3];
  real_T c2_D;
  int32_T c2_i14;
  real_T c2_H[2];
  int32_T c2_i15;
  real_T c2_Q[4];
  real_T c2_R;
  int32_T c2_i16;
  real_T c2_xk[3];
  int32_T c2_i17;
  real_T c2_Pk[9];
  real_T c2_y;
  real_T c2_nargout = 2.0;
  real_T c2_nargin = 12.0;
  real_T c2_K[3];
  real_T c2_Pkplus1[9];
  real_T c2_xkplus1[3];
  int32_T c2_i18;
  real_T c2_a[6];
  int32_T c2_i19;
  real_T c2_b[4];
  int32_T c2_i20;
  real_T c2_A[6];
  int32_T c2_i21;
  real_T c2_B[4];
  int32_T c2_i22;
  real_T c2_b_A[6];
  int32_T c2_i23;
  real_T c2_b_B[4];
  int32_T c2_i24;
  real_T c2_c_A[6];
  int32_T c2_i25;
  real_T c2_c_B[4];
  int32_T c2_i26;
  int32_T c2_i27;
  real_T c2_b_a[6];
  int32_T c2_i28;
  int32_T c2_i29;
  real_T c2_b_b[2];
  int32_T c2_i30;
  real_T c2_d_A[6];
  int32_T c2_i31;
  real_T c2_d_B[2];
  int32_T c2_i32;
  real_T c2_e_A[6];
  int32_T c2_i33;
  real_T c2_e_B[2];
  int32_T c2_i34;
  real_T c2_f_A[6];
  int32_T c2_i35;
  real_T c2_f_B[2];
  int32_T c2_i36;
  real_T c2_b_y[3];
  int32_T c2_i37;
  int32_T c2_i38;
  real_T c2_c_a[9];
  int32_T c2_i39;
  real_T c2_c_b[9];
  int32_T c2_i40;
  real_T c2_g_A[9];
  int32_T c2_i41;
  real_T c2_g_B[9];
  int32_T c2_i42;
  real_T c2_h_A[9];
  int32_T c2_i43;
  real_T c2_h_B[9];
  int32_T c2_i44;
  real_T c2_i_A[9];
  int32_T c2_i45;
  real_T c2_i_B[9];
  int32_T c2_i46;
  int32_T c2_i47;
  real_T c2_d_a[9];
  int32_T c2_i48;
  int32_T c2_i49;
  real_T c2_d_b[3];
  int32_T c2_i50;
  real_T c2_j_A[9];
  int32_T c2_i51;
  real_T c2_j_B[3];
  int32_T c2_i52;
  real_T c2_k_A[9];
  int32_T c2_i53;
  real_T c2_k_B[3];
  int32_T c2_i54;
  real_T c2_l_A[9];
  int32_T c2_i55;
  real_T c2_l_B[3];
  int32_T c2_i56;
  real_T c2_c_y[3];
  int32_T c2_i57;
  int32_T c2_i58;
  real_T c2_e_a[3];
  int32_T c2_i59;
  real_T c2_f_a[2];
  int32_T c2_i60;
  real_T c2_e_b[4];
  int32_T c2_i61;
  real_T c2_m_A[2];
  int32_T c2_i62;
  real_T c2_m_B[4];
  int32_T c2_i63;
  real_T c2_n_A[2];
  int32_T c2_i64;
  real_T c2_n_B[4];
  int32_T c2_i65;
  real_T c2_o_A[2];
  int32_T c2_i66;
  real_T c2_o_B[4];
  int32_T c2_i67;
  real_T c2_g_a[2];
  int32_T c2_i68;
  int32_T c2_i69;
  real_T c2_f_b[2];
  int32_T c2_i70;
  real_T c2_x[2];
  int32_T c2_i71;
  real_T c2_d_y[2];
  int32_T c2_i72;
  real_T c2_b_x[2];
  int32_T c2_i73;
  real_T c2_e_y[2];
  int32_T c2_i74;
  real_T c2_c_x[2];
  int32_T c2_i75;
  real_T c2_f_y[2];
  int32_T c2_i76;
  real_T c2_d_x[2];
  int32_T c2_i77;
  real_T c2_g_y[2];
  int32_T c2_i78;
  real_T c2_e_x[2];
  int32_T c2_i79;
  real_T c2_h_y[2];
  real_T c2_i_y;
  int32_T c2_k;
  int32_T c2_b_k;
  int32_T c2_i80;
  real_T c2_h_a[3];
  int32_T c2_i81;
  real_T c2_g_b[9];
  int32_T c2_i82;
  real_T c2_p_A[3];
  int32_T c2_i83;
  real_T c2_p_B[9];
  int32_T c2_i84;
  real_T c2_q_A[3];
  int32_T c2_i85;
  real_T c2_q_B[9];
  int32_T c2_i86;
  real_T c2_r_A[3];
  int32_T c2_i87;
  real_T c2_r_B[9];
  int32_T c2_i88;
  real_T c2_i_a[3];
  int32_T c2_i89;
  int32_T c2_i90;
  real_T c2_h_b[3];
  int32_T c2_i91;
  real_T c2_f_x[3];
  int32_T c2_i92;
  real_T c2_j_y[3];
  int32_T c2_i93;
  real_T c2_g_x[3];
  int32_T c2_i94;
  real_T c2_k_y[3];
  int32_T c2_i95;
  real_T c2_h_x[3];
  int32_T c2_i96;
  real_T c2_l_y[3];
  int32_T c2_i97;
  real_T c2_i_x[3];
  int32_T c2_i98;
  real_T c2_m_y[3];
  int32_T c2_i99;
  real_T c2_j_x[3];
  int32_T c2_i100;
  real_T c2_n_y[3];
  real_T c2_o_y;
  int32_T c2_c_k;
  int32_T c2_d_k;
  real_T c2_i_b;
  int32_T c2_i101;
  int32_T c2_i102;
  real_T c2_j_a[3];
  real_T c2_k_a;
  real_T c2_j_b;
  real_T c2_p_y;
  int32_T c2_i103;
  real_T c2_l_a[3];
  int32_T c2_i104;
  real_T c2_k_b[3];
  int32_T c2_i105;
  real_T c2_k_x[3];
  int32_T c2_i106;
  real_T c2_q_y[3];
  int32_T c2_i107;
  real_T c2_l_x[3];
  int32_T c2_i108;
  real_T c2_r_y[3];
  int32_T c2_i109;
  real_T c2_m_x[3];
  int32_T c2_i110;
  real_T c2_s_y[3];
  int32_T c2_i111;
  real_T c2_n_x[3];
  int32_T c2_i112;
  real_T c2_t_y[3];
  int32_T c2_i113;
  real_T c2_o_x[3];
  int32_T c2_i114;
  real_T c2_u_y[3];
  real_T c2_v_y;
  int32_T c2_e_k;
  int32_T c2_f_k;
  real_T c2_l_b;
  int32_T c2_i115;
  real_T c2_w_y[3];
  int32_T c2_i116;
  real_T c2_m_a[3];
  real_T c2_m_b;
  int32_T c2_i117;
  real_T c2_x_y[3];
  int32_T c2_i118;
  real_T c2_n_a[9];
  int32_T c2_i119;
  real_T c2_n_b[3];
  int32_T c2_i120;
  real_T c2_s_A[9];
  int32_T c2_i121;
  real_T c2_s_B[3];
  int32_T c2_i122;
  real_T c2_t_A[9];
  int32_T c2_i123;
  real_T c2_t_B[3];
  int32_T c2_i124;
  real_T c2_u_A[9];
  int32_T c2_i125;
  real_T c2_u_B[3];
  int32_T c2_i126;
  real_T c2_y_y[3];
  int32_T c2_i127;
  int32_T c2_i128;
  int32_T c2_i129;
  real_T c2_o_a[3];
  int32_T c2_i130;
  real_T c2_p_a[2];
  int32_T c2_i131;
  real_T c2_o_b[4];
  int32_T c2_i132;
  real_T c2_v_A[2];
  int32_T c2_i133;
  real_T c2_v_B[4];
  int32_T c2_i134;
  real_T c2_w_A[2];
  int32_T c2_i135;
  real_T c2_w_B[4];
  int32_T c2_i136;
  real_T c2_x_A[2];
  int32_T c2_i137;
  real_T c2_x_B[4];
  int32_T c2_i138;
  real_T c2_q_a[2];
  int32_T c2_i139;
  int32_T c2_i140;
  int32_T c2_i141;
  real_T c2_p_b[6];
  int32_T c2_i142;
  real_T c2_y_A[2];
  int32_T c2_i143;
  real_T c2_y_B[6];
  int32_T c2_i144;
  real_T c2_ab_A[2];
  int32_T c2_i145;
  real_T c2_ab_B[6];
  int32_T c2_i146;
  real_T c2_bb_A[2];
  int32_T c2_i147;
  real_T c2_bb_B[6];
  int32_T c2_i148;
  real_T c2_ab_y[3];
  int32_T c2_i149;
  int32_T c2_i150;
  real_T c2_r_a[3];
  int32_T c2_i151;
  real_T c2_q_b[9];
  int32_T c2_i152;
  real_T c2_cb_A[3];
  int32_T c2_i153;
  real_T c2_cb_B[9];
  int32_T c2_i154;
  real_T c2_db_A[3];
  int32_T c2_i155;
  real_T c2_db_B[9];
  int32_T c2_i156;
  real_T c2_eb_A[3];
  int32_T c2_i157;
  real_T c2_eb_B[9];
  int32_T c2_i158;
  real_T c2_s_a[3];
  int32_T c2_i159;
  int32_T c2_i160;
  int32_T c2_i161;
  real_T c2_r_b[9];
  int32_T c2_i162;
  real_T c2_fb_A[3];
  int32_T c2_i163;
  real_T c2_fb_B[9];
  int32_T c2_i164;
  real_T c2_gb_A[3];
  int32_T c2_i165;
  real_T c2_gb_B[9];
  int32_T c2_i166;
  real_T c2_hb_A[3];
  int32_T c2_i167;
  real_T c2_hb_B[9];
  int32_T c2_i168;
  real_T c2_bb_y[3];
  int32_T c2_i169;
  int32_T c2_i170;
  real_T c2_s_b[3];
  int32_T c2_i171;
  int32_T c2_i172;
  real_T c2_cb_y[9];
  int32_T c2_i173;
  real_T c2_t_a[6];
  int32_T c2_i174;
  real_T c2_t_b[4];
  int32_T c2_i175;
  real_T c2_ib_A[6];
  int32_T c2_i176;
  real_T c2_ib_B[4];
  int32_T c2_i177;
  real_T c2_jb_A[6];
  int32_T c2_i178;
  real_T c2_jb_B[4];
  int32_T c2_i179;
  real_T c2_kb_A[6];
  int32_T c2_i180;
  real_T c2_kb_B[4];
  int32_T c2_i181;
  int32_T c2_i182;
  real_T c2_u_a[6];
  int32_T c2_i183;
  int32_T c2_i184;
  int32_T c2_i185;
  real_T c2_u_b[6];
  int32_T c2_i186;
  real_T c2_lb_A[6];
  int32_T c2_i187;
  real_T c2_lb_B[6];
  int32_T c2_i188;
  real_T c2_mb_A[6];
  int32_T c2_i189;
  real_T c2_mb_B[6];
  int32_T c2_i190;
  real_T c2_nb_A[6];
  int32_T c2_i191;
  real_T c2_nb_B[6];
  int32_T c2_i192;
  int32_T c2_i193;
  real_T c2_db_y[9];
  int32_T c2_i194;
  int32_T c2_i195;
  real_T c2_v_a[9];
  int32_T c2_i196;
  real_T c2_v_b[9];
  int32_T c2_i197;
  real_T c2_ob_A[9];
  int32_T c2_i198;
  real_T c2_ob_B[9];
  int32_T c2_i199;
  real_T c2_pb_A[9];
  int32_T c2_i200;
  real_T c2_pb_B[9];
  int32_T c2_i201;
  real_T c2_qb_A[9];
  int32_T c2_i202;
  real_T c2_qb_B[9];
  int32_T c2_i203;
  int32_T c2_i204;
  real_T c2_w_a[9];
  int32_T c2_i205;
  int32_T c2_i206;
  int32_T c2_i207;
  real_T c2_w_b[9];
  int32_T c2_i208;
  real_T c2_rb_A[9];
  int32_T c2_i209;
  real_T c2_rb_B[9];
  int32_T c2_i210;
  real_T c2_sb_A[9];
  int32_T c2_i211;
  real_T c2_sb_B[9];
  int32_T c2_i212;
  real_T c2_tb_A[9];
  int32_T c2_i213;
  real_T c2_tb_B[9];
  int32_T c2_i214;
  int32_T c2_i215;
  real_T c2_eb_y[9];
  int32_T c2_i216;
  int32_T c2_i217;
  int32_T c2_i218;
  int32_T c2_i219;
  real_T *c2_fb_y;
  real_T *c2_b_R;
  real_T *c2_b_D;
  real_T *c2_b_u;
  real_T (*c2_b_xkplus1)[3];
  real_T (*c2_b_Pkplus1)[9];
  real_T (*c2_b_Pk)[9];
  real_T (*c2_b_xk)[3];
  real_T (*c2_b_Q)[4];
  real_T (*c2_b_H)[2];
  real_T (*c2_b_C)[3];
  real_T (*c2_b_G)[6];
  real_T (*c2_b_Gamma)[3];
  real_T (*c2_b_Phi)[9];
  c2_b_H = (real_T (*)[2])ssGetInputPortSignal(chartInstance.S, 6);
  c2_b_xkplus1 = (real_T (*)[3])ssGetOutputPortSignal(chartInstance.S, 1);
  c2_b_Q = (real_T (*)[4])ssGetInputPortSignal(chartInstance.S, 7);
  c2_b_D = (real_T *)ssGetInputPortSignal(chartInstance.S, 5);
  c2_fb_y = (real_T *)ssGetInputPortSignal(chartInstance.S, 11);
  c2_b_Phi = (real_T (*)[9])ssGetInputPortSignal(chartInstance.S, 1);
  c2_b_u = (real_T *)ssGetInputPortSignal(chartInstance.S, 0);
  c2_b_G = (real_T (*)[6])ssGetInputPortSignal(chartInstance.S, 3);
  c2_b_xk = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 9);
  c2_b_Pk = (real_T (*)[9])ssGetInputPortSignal(chartInstance.S, 10);
  c2_b_Gamma = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 2);
  c2_b_R = (real_T *)ssGetInputPortSignal(chartInstance.S, 8);
  c2_b_C = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 4);
  c2_b_Pkplus1 = (real_T (*)[9])ssGetOutputPortSignal(chartInstance.S, 2);
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG,0);
  c2_u = *c2_b_u;
  for (c2_i10 = 0; c2_i10 < 9; c2_i10 = c2_i10 + 1) {
    c2_Phi[c2_i10] = (*c2_b_Phi)[c2_i10];
  }

  for (c2_i11 = 0; c2_i11 < 3; c2_i11 = c2_i11 + 1) {
    c2_Gamma[c2_i11] = (*c2_b_Gamma)[c2_i11];
  }

  for (c2_i12 = 0; c2_i12 < 6; c2_i12 = c2_i12 + 1) {
    c2_G[c2_i12] = (*c2_b_G)[c2_i12];
  }

  for (c2_i13 = 0; c2_i13 < 3; c2_i13 = c2_i13 + 1) {
    c2_C[c2_i13] = (*c2_b_C)[c2_i13];
  }

  c2_D = *c2_b_D;
  for (c2_i14 = 0; c2_i14 < 2; c2_i14 = c2_i14 + 1) {
    c2_H[c2_i14] = (*c2_b_H)[c2_i14];
  }

  for (c2_i15 = 0; c2_i15 < 4; c2_i15 = c2_i15 + 1) {
    c2_Q[c2_i15] = (*c2_b_Q)[c2_i15];
  }

  c2_R = *c2_b_R;
  for (c2_i16 = 0; c2_i16 < 3; c2_i16 = c2_i16 + 1) {
    c2_xk[c2_i16] = (*c2_b_xk)[c2_i16];
  }

  for (c2_i17 = 0; c2_i17 < 9; c2_i17 = c2_i17 + 1) {
    c2_Pk[c2_i17] = (*c2_b_Pk)[c2_i17];
  }

  c2_y = *c2_fb_y;
  sf_debug_symbol_scope_push(17U, 0U);
  sf_debug_symbol_scope_add("nargout", &c2_nargout, c2_sf_marshall);
  sf_debug_symbol_scope_add("nargin", &c2_nargin, c2_sf_marshall);
  sf_debug_symbol_scope_add("K", &c2_K, c2_c_sf_marshall);
  sf_debug_symbol_scope_add("Pkplus1", &c2_Pkplus1, c2_b_sf_marshall);
  sf_debug_symbol_scope_add("xkplus1", &c2_xkplus1, c2_c_sf_marshall);
  sf_debug_symbol_scope_add("y", &c2_y, c2_sf_marshall);
  sf_debug_symbol_scope_add("Pk", &c2_Pk, c2_b_sf_marshall);
  sf_debug_symbol_scope_add("xk", &c2_xk, c2_c_sf_marshall);
  sf_debug_symbol_scope_add("R", &c2_R, c2_sf_marshall);
  sf_debug_symbol_scope_add("Q", &c2_Q, c2_g_sf_marshall);
  sf_debug_symbol_scope_add("H", &c2_H, c2_f_sf_marshall);
  sf_debug_symbol_scope_add("D", &c2_D, c2_sf_marshall);
  sf_debug_symbol_scope_add("C", &c2_C, c2_e_sf_marshall);
  sf_debug_symbol_scope_add("G", &c2_G, c2_d_sf_marshall);
  sf_debug_symbol_scope_add("Gamma", &c2_Gamma, c2_c_sf_marshall);
  sf_debug_symbol_scope_add("Phi", &c2_Phi, c2_b_sf_marshall);
  sf_debug_symbol_scope_add("u", &c2_u, c2_sf_marshall);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0,3);
  for (c2_i18 = 0; c2_i18 < 6; c2_i18 = c2_i18 + 1) {
    c2_a[c2_i18] = c2_G[c2_i18];
  }

  for (c2_i19 = 0; c2_i19 < 4; c2_i19 = c2_i19 + 1) {
    c2_b[c2_i19] = c2_Q[c2_i19];
  }

  for (c2_i20 = 0; c2_i20 < 6; c2_i20 = c2_i20 + 1) {
    c2_A[c2_i20] = c2_a[c2_i20];
  }

  for (c2_i21 = 0; c2_i21 < 4; c2_i21 = c2_i21 + 1) {
    c2_B[c2_i21] = c2_b[c2_i21];
  }

  for (c2_i22 = 0; c2_i22 < 6; c2_i22 = c2_i22 + 1) {
    c2_b_A[c2_i22] = c2_A[c2_i22];
  }

  for (c2_i23 = 0; c2_i23 < 4; c2_i23 = c2_i23 + 1) {
    c2_b_B[c2_i23] = c2_B[c2_i23];
  }

  for (c2_i24 = 0; c2_i24 < 6; c2_i24 = c2_i24 + 1) {
    c2_c_A[c2_i24] = c2_b_A[c2_i24];
  }

  for (c2_i25 = 0; c2_i25 < 4; c2_i25 = c2_i25 + 1) {
    c2_c_B[c2_i25] = c2_b_B[c2_i25];
  }

  for (c2_i26 = 0; c2_i26 < 3; c2_i26 = c2_i26 + 1) {
    for (c2_i27 = 0; c2_i27 < 2; c2_i27 = c2_i27 + 1) {
      c2_b_a[c2_i26 + 3 * c2_i27] = 0.0;
      for (c2_i28 = 0; c2_i28 < 2; c2_i28 = c2_i28 + 1) {
        c2_b_a[c2_i26 + 3 * c2_i27] = c2_b_a[c2_i26 + 3 * c2_i27] +
          c2_c_A[c2_i26 + 3 * c2_i28] * c2_c_B[c2_i28 + 2 * c2_i27];
      }
    }
  }

  for (c2_i29 = 0; c2_i29 < 2; c2_i29 = c2_i29 + 1) {
    c2_b_b[c2_i29] = c2_H[c2_i29];
  }

  for (c2_i30 = 0; c2_i30 < 6; c2_i30 = c2_i30 + 1) {
    c2_d_A[c2_i30] = c2_b_a[c2_i30];
  }

  for (c2_i31 = 0; c2_i31 < 2; c2_i31 = c2_i31 + 1) {
    c2_d_B[c2_i31] = c2_b_b[c2_i31];
  }

  for (c2_i32 = 0; c2_i32 < 6; c2_i32 = c2_i32 + 1) {
    c2_e_A[c2_i32] = c2_d_A[c2_i32];
  }

  for (c2_i33 = 0; c2_i33 < 2; c2_i33 = c2_i33 + 1) {
    c2_e_B[c2_i33] = c2_d_B[c2_i33];
  }

  for (c2_i34 = 0; c2_i34 < 6; c2_i34 = c2_i34 + 1) {
    c2_f_A[c2_i34] = c2_e_A[c2_i34];
  }

  for (c2_i35 = 0; c2_i35 < 2; c2_i35 = c2_i35 + 1) {
    c2_f_B[c2_i35] = c2_e_B[c2_i35];
  }

  for (c2_i36 = 0; c2_i36 < 3; c2_i36 = c2_i36 + 1) {
    c2_b_y[c2_i36] = 0.0;
    for (c2_i37 = 0; c2_i37 < 2; c2_i37 = c2_i37 + 1) {
      c2_b_y[c2_i36] = c2_b_y[c2_i36] + c2_f_A[c2_i36 + 3 * c2_i37] *
        c2_f_B[c2_i37];
    }
  }

  for (c2_i38 = 0; c2_i38 < 9; c2_i38 = c2_i38 + 1) {
    c2_c_a[c2_i38] = c2_Phi[c2_i38];
  }

  for (c2_i39 = 0; c2_i39 < 9; c2_i39 = c2_i39 + 1) {
    c2_c_b[c2_i39] = c2_Pk[c2_i39];
  }

  for (c2_i40 = 0; c2_i40 < 9; c2_i40 = c2_i40 + 1) {
    c2_g_A[c2_i40] = c2_c_a[c2_i40];
  }

  for (c2_i41 = 0; c2_i41 < 9; c2_i41 = c2_i41 + 1) {
    c2_g_B[c2_i41] = c2_c_b[c2_i41];
  }

  for (c2_i42 = 0; c2_i42 < 9; c2_i42 = c2_i42 + 1) {
    c2_h_A[c2_i42] = c2_g_A[c2_i42];
  }

  for (c2_i43 = 0; c2_i43 < 9; c2_i43 = c2_i43 + 1) {
    c2_h_B[c2_i43] = c2_g_B[c2_i43];
  }

  for (c2_i44 = 0; c2_i44 < 9; c2_i44 = c2_i44 + 1) {
    c2_i_A[c2_i44] = c2_h_A[c2_i44];
  }

  for (c2_i45 = 0; c2_i45 < 9; c2_i45 = c2_i45 + 1) {
    c2_i_B[c2_i45] = c2_h_B[c2_i45];
  }

  for (c2_i46 = 0; c2_i46 < 3; c2_i46 = c2_i46 + 1) {
    for (c2_i47 = 0; c2_i47 < 3; c2_i47 = c2_i47 + 1) {
      c2_d_a[c2_i46 + 3 * c2_i47] = 0.0;
      for (c2_i48 = 0; c2_i48 < 3; c2_i48 = c2_i48 + 1) {
        c2_d_a[c2_i46 + 3 * c2_i47] = c2_d_a[c2_i46 + 3 * c2_i47] +
          c2_i_A[c2_i46 + 3 * c2_i48] * c2_i_B[c2_i48 + 3 * c2_i47];
      }
    }
  }

  for (c2_i49 = 0; c2_i49 < 3; c2_i49 = c2_i49 + 1) {
    c2_d_b[c2_i49] = c2_C[c2_i49];
  }

  for (c2_i50 = 0; c2_i50 < 9; c2_i50 = c2_i50 + 1) {
    c2_j_A[c2_i50] = c2_d_a[c2_i50];
  }

  for (c2_i51 = 0; c2_i51 < 3; c2_i51 = c2_i51 + 1) {
    c2_j_B[c2_i51] = c2_d_b[c2_i51];
  }

  for (c2_i52 = 0; c2_i52 < 9; c2_i52 = c2_i52 + 1) {
    c2_k_A[c2_i52] = c2_j_A[c2_i52];
  }

  for (c2_i53 = 0; c2_i53 < 3; c2_i53 = c2_i53 + 1) {
    c2_k_B[c2_i53] = c2_j_B[c2_i53];
  }

  for (c2_i54 = 0; c2_i54 < 9; c2_i54 = c2_i54 + 1) {
    c2_l_A[c2_i54] = c2_k_A[c2_i54];
  }

  for (c2_i55 = 0; c2_i55 < 3; c2_i55 = c2_i55 + 1) {
    c2_l_B[c2_i55] = c2_k_B[c2_i55];
  }

  for (c2_i56 = 0; c2_i56 < 3; c2_i56 = c2_i56 + 1) {
    c2_c_y[c2_i56] = 0.0;
    for (c2_i57 = 0; c2_i57 < 3; c2_i57 = c2_i57 + 1) {
      c2_c_y[c2_i56] = c2_c_y[c2_i56] + c2_l_A[c2_i56 + 3 * c2_i57] *
        c2_l_B[c2_i57];
    }
  }

  for (c2_i58 = 0; c2_i58 < 3; c2_i58 = c2_i58 + 1) {
    c2_e_a[c2_i58] = c2_c_y[c2_i58] + c2_b_y[c2_i58];
  }

  for (c2_i59 = 0; c2_i59 < 2; c2_i59 = c2_i59 + 1) {
    c2_f_a[c2_i59] = c2_H[c2_i59];
  }

  for (c2_i60 = 0; c2_i60 < 4; c2_i60 = c2_i60 + 1) {
    c2_e_b[c2_i60] = c2_Q[c2_i60];
  }

  for (c2_i61 = 0; c2_i61 < 2; c2_i61 = c2_i61 + 1) {
    c2_m_A[c2_i61] = c2_f_a[c2_i61];
  }

  for (c2_i62 = 0; c2_i62 < 4; c2_i62 = c2_i62 + 1) {
    c2_m_B[c2_i62] = c2_e_b[c2_i62];
  }

  for (c2_i63 = 0; c2_i63 < 2; c2_i63 = c2_i63 + 1) {
    c2_n_A[c2_i63] = c2_m_A[c2_i63];
  }

  for (c2_i64 = 0; c2_i64 < 4; c2_i64 = c2_i64 + 1) {
    c2_n_B[c2_i64] = c2_m_B[c2_i64];
  }

  for (c2_i65 = 0; c2_i65 < 2; c2_i65 = c2_i65 + 1) {
    c2_o_A[c2_i65] = c2_n_A[c2_i65];
  }

  for (c2_i66 = 0; c2_i66 < 4; c2_i66 = c2_i66 + 1) {
    c2_o_B[c2_i66] = c2_n_B[c2_i66];
  }

  for (c2_i67 = 0; c2_i67 < 2; c2_i67 = c2_i67 + 1) {
    c2_g_a[c2_i67] = 0.0;
    for (c2_i68 = 0; c2_i68 < 2; c2_i68 = c2_i68 + 1) {
      c2_g_a[c2_i67] = c2_g_a[c2_i67] + c2_o_A[c2_i68] * c2_o_B[c2_i68 + 2 *
        c2_i67];
    }
  }

  for (c2_i69 = 0; c2_i69 < 2; c2_i69 = c2_i69 + 1) {
    c2_f_b[c2_i69] = c2_H[c2_i69];
  }

  for (c2_i70 = 0; c2_i70 < 2; c2_i70 = c2_i70 + 1) {
    c2_x[c2_i70] = c2_g_a[c2_i70];
  }

  for (c2_i71 = 0; c2_i71 < 2; c2_i71 = c2_i71 + 1) {
    c2_d_y[c2_i71] = c2_f_b[c2_i71];
  }

  for (c2_i72 = 0; c2_i72 < 2; c2_i72 = c2_i72 + 1) {
    c2_b_x[c2_i72] = c2_x[c2_i72];
  }

  for (c2_i73 = 0; c2_i73 < 2; c2_i73 = c2_i73 + 1) {
    c2_e_y[c2_i73] = c2_d_y[c2_i73];
  }

  for (c2_i74 = 0; c2_i74 < 2; c2_i74 = c2_i74 + 1) {
    c2_c_x[c2_i74] = c2_b_x[c2_i74];
  }

  for (c2_i75 = 0; c2_i75 < 2; c2_i75 = c2_i75 + 1) {
    c2_f_y[c2_i75] = c2_e_y[c2_i75];
  }

  for (c2_i76 = 0; c2_i76 < 2; c2_i76 = c2_i76 + 1) {
    c2_d_x[c2_i76] = c2_c_x[c2_i76];
  }

  for (c2_i77 = 0; c2_i77 < 2; c2_i77 = c2_i77 + 1) {
    c2_g_y[c2_i77] = c2_f_y[c2_i77];
  }

  for (c2_i78 = 0; c2_i78 < 2; c2_i78 = c2_i78 + 1) {
    c2_e_x[c2_i78] = c2_d_x[c2_i78];
  }

  for (c2_i79 = 0; c2_i79 < 2; c2_i79 = c2_i79 + 1) {
    c2_h_y[c2_i79] = c2_g_y[c2_i79];
  }

  c2_i_y = 0.0;
  for (c2_k = 1; c2_k < 3; c2_k = c2_k + 1) {
    c2_b_k = c2_k;
    c2_i_y = c2_i_y + c2_e_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK
      ("k", (real_T)c2_b_k), 1, 2, 1, 0) - 1] * c2_h_y[
      _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("k", (real_T)c2_b_k),
      1, 2, 1, 0) - 1];
  }

  for (c2_i80 = 0; c2_i80 < 3; c2_i80 = c2_i80 + 1) {
    c2_h_a[c2_i80] = c2_C[c2_i80];
  }

  for (c2_i81 = 0; c2_i81 < 9; c2_i81 = c2_i81 + 1) {
    c2_g_b[c2_i81] = c2_Pk[c2_i81];
  }

  for (c2_i82 = 0; c2_i82 < 3; c2_i82 = c2_i82 + 1) {
    c2_p_A[c2_i82] = c2_h_a[c2_i82];
  }

  for (c2_i83 = 0; c2_i83 < 9; c2_i83 = c2_i83 + 1) {
    c2_p_B[c2_i83] = c2_g_b[c2_i83];
  }

  for (c2_i84 = 0; c2_i84 < 3; c2_i84 = c2_i84 + 1) {
    c2_q_A[c2_i84] = c2_p_A[c2_i84];
  }

  for (c2_i85 = 0; c2_i85 < 9; c2_i85 = c2_i85 + 1) {
    c2_q_B[c2_i85] = c2_p_B[c2_i85];
  }

  for (c2_i86 = 0; c2_i86 < 3; c2_i86 = c2_i86 + 1) {
    c2_r_A[c2_i86] = c2_q_A[c2_i86];
  }

  for (c2_i87 = 0; c2_i87 < 9; c2_i87 = c2_i87 + 1) {
    c2_r_B[c2_i87] = c2_q_B[c2_i87];
  }

  for (c2_i88 = 0; c2_i88 < 3; c2_i88 = c2_i88 + 1) {
    c2_i_a[c2_i88] = 0.0;
    for (c2_i89 = 0; c2_i89 < 3; c2_i89 = c2_i89 + 1) {
      c2_i_a[c2_i88] = c2_i_a[c2_i88] + c2_r_A[c2_i89] * c2_r_B[c2_i89 + 3 *
        c2_i88];
    }
  }

  for (c2_i90 = 0; c2_i90 < 3; c2_i90 = c2_i90 + 1) {
    c2_h_b[c2_i90] = c2_C[c2_i90];
  }

  for (c2_i91 = 0; c2_i91 < 3; c2_i91 = c2_i91 + 1) {
    c2_f_x[c2_i91] = c2_i_a[c2_i91];
  }

  for (c2_i92 = 0; c2_i92 < 3; c2_i92 = c2_i92 + 1) {
    c2_j_y[c2_i92] = c2_h_b[c2_i92];
  }

  for (c2_i93 = 0; c2_i93 < 3; c2_i93 = c2_i93 + 1) {
    c2_g_x[c2_i93] = c2_f_x[c2_i93];
  }

  for (c2_i94 = 0; c2_i94 < 3; c2_i94 = c2_i94 + 1) {
    c2_k_y[c2_i94] = c2_j_y[c2_i94];
  }

  for (c2_i95 = 0; c2_i95 < 3; c2_i95 = c2_i95 + 1) {
    c2_h_x[c2_i95] = c2_g_x[c2_i95];
  }

  for (c2_i96 = 0; c2_i96 < 3; c2_i96 = c2_i96 + 1) {
    c2_l_y[c2_i96] = c2_k_y[c2_i96];
  }

  for (c2_i97 = 0; c2_i97 < 3; c2_i97 = c2_i97 + 1) {
    c2_i_x[c2_i97] = c2_h_x[c2_i97];
  }

  for (c2_i98 = 0; c2_i98 < 3; c2_i98 = c2_i98 + 1) {
    c2_m_y[c2_i98] = c2_l_y[c2_i98];
  }

  for (c2_i99 = 0; c2_i99 < 3; c2_i99 = c2_i99 + 1) {
    c2_j_x[c2_i99] = c2_i_x[c2_i99];
  }

  for (c2_i100 = 0; c2_i100 < 3; c2_i100 = c2_i100 + 1) {
    c2_n_y[c2_i100] = c2_m_y[c2_i100];
  }

  c2_o_y = 0.0;
  for (c2_c_k = 1; c2_c_k < 4; c2_c_k = c2_c_k + 1) {
    c2_d_k = c2_c_k;
    c2_o_y = c2_o_y + c2_j_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK
      ("k", (real_T)c2_d_k), 1, 3, 1, 0) - 1] * c2_n_y[
      _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("k", (real_T)c2_d_k),
      1, 3, 1, 0) - 1];
  }

  c2_i_b = c2_mpower((c2_o_y + c2_i_y) + c2_R);
  for (c2_i101 = 0; c2_i101 < 3; c2_i101 = c2_i101 + 1) {
    c2_K[c2_i101] = c2_e_a[c2_i101] * c2_i_b;
  }

  _SFD_EML_CALL(0,4);
  for (c2_i102 = 0; c2_i102 < 3; c2_i102 = c2_i102 + 1) {
    c2_j_a[c2_i102] = c2_K[c2_i102];
  }

  c2_k_a = c2_D;
  c2_j_b = c2_u;
  c2_p_y = c2_k_a * c2_j_b;
  for (c2_i103 = 0; c2_i103 < 3; c2_i103 = c2_i103 + 1) {
    c2_l_a[c2_i103] = c2_C[c2_i103];
  }

  for (c2_i104 = 0; c2_i104 < 3; c2_i104 = c2_i104 + 1) {
    c2_k_b[c2_i104] = c2_xk[c2_i104];
  }

  for (c2_i105 = 0; c2_i105 < 3; c2_i105 = c2_i105 + 1) {
    c2_k_x[c2_i105] = c2_l_a[c2_i105];
  }

  for (c2_i106 = 0; c2_i106 < 3; c2_i106 = c2_i106 + 1) {
    c2_q_y[c2_i106] = c2_k_b[c2_i106];
  }

  for (c2_i107 = 0; c2_i107 < 3; c2_i107 = c2_i107 + 1) {
    c2_l_x[c2_i107] = c2_k_x[c2_i107];
  }

  for (c2_i108 = 0; c2_i108 < 3; c2_i108 = c2_i108 + 1) {
    c2_r_y[c2_i108] = c2_q_y[c2_i108];
  }

  for (c2_i109 = 0; c2_i109 < 3; c2_i109 = c2_i109 + 1) {
    c2_m_x[c2_i109] = c2_l_x[c2_i109];
  }

  for (c2_i110 = 0; c2_i110 < 3; c2_i110 = c2_i110 + 1) {
    c2_s_y[c2_i110] = c2_r_y[c2_i110];
  }

  for (c2_i111 = 0; c2_i111 < 3; c2_i111 = c2_i111 + 1) {
    c2_n_x[c2_i111] = c2_m_x[c2_i111];
  }

  for (c2_i112 = 0; c2_i112 < 3; c2_i112 = c2_i112 + 1) {
    c2_t_y[c2_i112] = c2_s_y[c2_i112];
  }

  for (c2_i113 = 0; c2_i113 < 3; c2_i113 = c2_i113 + 1) {
    c2_o_x[c2_i113] = c2_n_x[c2_i113];
  }

  for (c2_i114 = 0; c2_i114 < 3; c2_i114 = c2_i114 + 1) {
    c2_u_y[c2_i114] = c2_t_y[c2_i114];
  }

  c2_v_y = 0.0;
  for (c2_e_k = 1; c2_e_k < 4; c2_e_k = c2_e_k + 1) {
    c2_f_k = c2_e_k;
    c2_v_y = c2_v_y + c2_o_x[_SFD_EML_ARRAY_BOUNDS_CHECK("x", _SFD_INTEGER_CHECK
      ("k", (real_T)c2_f_k), 1, 3, 1, 0) - 1] * c2_u_y[
      _SFD_EML_ARRAY_BOUNDS_CHECK("y", _SFD_INTEGER_CHECK("k", (real_T)c2_f_k),
      1, 3, 1, 0) - 1];
  }

  c2_l_b = (c2_y - c2_v_y) - c2_p_y;
  for (c2_i115 = 0; c2_i115 < 3; c2_i115 = c2_i115 + 1) {
    c2_w_y[c2_i115] = c2_j_a[c2_i115] * c2_l_b;
  }

  for (c2_i116 = 0; c2_i116 < 3; c2_i116 = c2_i116 + 1) {
    c2_m_a[c2_i116] = c2_Gamma[c2_i116];
  }

  c2_m_b = c2_u;
  for (c2_i117 = 0; c2_i117 < 3; c2_i117 = c2_i117 + 1) {
    c2_x_y[c2_i117] = c2_m_a[c2_i117] * c2_m_b;
  }

  for (c2_i118 = 0; c2_i118 < 9; c2_i118 = c2_i118 + 1) {
    c2_n_a[c2_i118] = c2_Phi[c2_i118];
  }

  for (c2_i119 = 0; c2_i119 < 3; c2_i119 = c2_i119 + 1) {
    c2_n_b[c2_i119] = c2_xk[c2_i119];
  }

  for (c2_i120 = 0; c2_i120 < 9; c2_i120 = c2_i120 + 1) {
    c2_s_A[c2_i120] = c2_n_a[c2_i120];
  }

  for (c2_i121 = 0; c2_i121 < 3; c2_i121 = c2_i121 + 1) {
    c2_s_B[c2_i121] = c2_n_b[c2_i121];
  }

  for (c2_i122 = 0; c2_i122 < 9; c2_i122 = c2_i122 + 1) {
    c2_t_A[c2_i122] = c2_s_A[c2_i122];
  }

  for (c2_i123 = 0; c2_i123 < 3; c2_i123 = c2_i123 + 1) {
    c2_t_B[c2_i123] = c2_s_B[c2_i123];
  }

  for (c2_i124 = 0; c2_i124 < 9; c2_i124 = c2_i124 + 1) {
    c2_u_A[c2_i124] = c2_t_A[c2_i124];
  }

  for (c2_i125 = 0; c2_i125 < 3; c2_i125 = c2_i125 + 1) {
    c2_u_B[c2_i125] = c2_t_B[c2_i125];
  }

  for (c2_i126 = 0; c2_i126 < 3; c2_i126 = c2_i126 + 1) {
    c2_y_y[c2_i126] = 0.0;
    for (c2_i127 = 0; c2_i127 < 3; c2_i127 = c2_i127 + 1) {
      c2_y_y[c2_i126] = c2_y_y[c2_i126] + c2_u_A[c2_i126 + 3 * c2_i127] *
        c2_u_B[c2_i127];
    }
  }

  for (c2_i128 = 0; c2_i128 < 3; c2_i128 = c2_i128 + 1) {
    c2_xkplus1[c2_i128] = (c2_y_y[c2_i128] + c2_x_y[c2_i128]) + c2_w_y[c2_i128];
  }

  _SFD_EML_CALL(0,5);
  for (c2_i129 = 0; c2_i129 < 3; c2_i129 = c2_i129 + 1) {
    c2_o_a[c2_i129] = c2_K[c2_i129];
  }

  for (c2_i130 = 0; c2_i130 < 2; c2_i130 = c2_i130 + 1) {
    c2_p_a[c2_i130] = c2_H[c2_i130];
  }

  for (c2_i131 = 0; c2_i131 < 4; c2_i131 = c2_i131 + 1) {
    c2_o_b[c2_i131] = c2_Q[c2_i131];
  }

  for (c2_i132 = 0; c2_i132 < 2; c2_i132 = c2_i132 + 1) {
    c2_v_A[c2_i132] = c2_p_a[c2_i132];
  }

  for (c2_i133 = 0; c2_i133 < 4; c2_i133 = c2_i133 + 1) {
    c2_v_B[c2_i133] = c2_o_b[c2_i133];
  }

  for (c2_i134 = 0; c2_i134 < 2; c2_i134 = c2_i134 + 1) {
    c2_w_A[c2_i134] = c2_v_A[c2_i134];
  }

  for (c2_i135 = 0; c2_i135 < 4; c2_i135 = c2_i135 + 1) {
    c2_w_B[c2_i135] = c2_v_B[c2_i135];
  }

  for (c2_i136 = 0; c2_i136 < 2; c2_i136 = c2_i136 + 1) {
    c2_x_A[c2_i136] = c2_w_A[c2_i136];
  }

  for (c2_i137 = 0; c2_i137 < 4; c2_i137 = c2_i137 + 1) {
    c2_x_B[c2_i137] = c2_w_B[c2_i137];
  }

  for (c2_i138 = 0; c2_i138 < 2; c2_i138 = c2_i138 + 1) {
    c2_q_a[c2_i138] = 0.0;
    for (c2_i139 = 0; c2_i139 < 2; c2_i139 = c2_i139 + 1) {
      c2_q_a[c2_i138] = c2_q_a[c2_i138] + c2_x_A[c2_i139] * c2_x_B[c2_i139 + 2 *
        c2_i138];
    }
  }

  for (c2_i140 = 0; c2_i140 < 3; c2_i140 = c2_i140 + 1) {
    for (c2_i141 = 0; c2_i141 < 2; c2_i141 = c2_i141 + 1) {
      c2_p_b[c2_i141 + 2 * c2_i140] = c2_G[c2_i140 + 3 * c2_i141];
    }
  }

  for (c2_i142 = 0; c2_i142 < 2; c2_i142 = c2_i142 + 1) {
    c2_y_A[c2_i142] = c2_q_a[c2_i142];
  }

  for (c2_i143 = 0; c2_i143 < 6; c2_i143 = c2_i143 + 1) {
    c2_y_B[c2_i143] = c2_p_b[c2_i143];
  }

  for (c2_i144 = 0; c2_i144 < 2; c2_i144 = c2_i144 + 1) {
    c2_ab_A[c2_i144] = c2_y_A[c2_i144];
  }

  for (c2_i145 = 0; c2_i145 < 6; c2_i145 = c2_i145 + 1) {
    c2_ab_B[c2_i145] = c2_y_B[c2_i145];
  }

  for (c2_i146 = 0; c2_i146 < 2; c2_i146 = c2_i146 + 1) {
    c2_bb_A[c2_i146] = c2_ab_A[c2_i146];
  }

  for (c2_i147 = 0; c2_i147 < 6; c2_i147 = c2_i147 + 1) {
    c2_bb_B[c2_i147] = c2_ab_B[c2_i147];
  }

  for (c2_i148 = 0; c2_i148 < 3; c2_i148 = c2_i148 + 1) {
    c2_ab_y[c2_i148] = 0.0;
    for (c2_i149 = 0; c2_i149 < 2; c2_i149 = c2_i149 + 1) {
      c2_ab_y[c2_i148] = c2_ab_y[c2_i148] + c2_bb_A[c2_i149] * c2_bb_B[c2_i149 +
        2 * c2_i148];
    }
  }

  for (c2_i150 = 0; c2_i150 < 3; c2_i150 = c2_i150 + 1) {
    c2_r_a[c2_i150] = c2_C[c2_i150];
  }

  for (c2_i151 = 0; c2_i151 < 9; c2_i151 = c2_i151 + 1) {
    c2_q_b[c2_i151] = c2_Pk[c2_i151];
  }

  for (c2_i152 = 0; c2_i152 < 3; c2_i152 = c2_i152 + 1) {
    c2_cb_A[c2_i152] = c2_r_a[c2_i152];
  }

  for (c2_i153 = 0; c2_i153 < 9; c2_i153 = c2_i153 + 1) {
    c2_cb_B[c2_i153] = c2_q_b[c2_i153];
  }

  for (c2_i154 = 0; c2_i154 < 3; c2_i154 = c2_i154 + 1) {
    c2_db_A[c2_i154] = c2_cb_A[c2_i154];
  }

  for (c2_i155 = 0; c2_i155 < 9; c2_i155 = c2_i155 + 1) {
    c2_db_B[c2_i155] = c2_cb_B[c2_i155];
  }

  for (c2_i156 = 0; c2_i156 < 3; c2_i156 = c2_i156 + 1) {
    c2_eb_A[c2_i156] = c2_db_A[c2_i156];
  }

  for (c2_i157 = 0; c2_i157 < 9; c2_i157 = c2_i157 + 1) {
    c2_eb_B[c2_i157] = c2_db_B[c2_i157];
  }

  for (c2_i158 = 0; c2_i158 < 3; c2_i158 = c2_i158 + 1) {
    c2_s_a[c2_i158] = 0.0;
    for (c2_i159 = 0; c2_i159 < 3; c2_i159 = c2_i159 + 1) {
      c2_s_a[c2_i158] = c2_s_a[c2_i158] + c2_eb_A[c2_i159] * c2_eb_B[c2_i159 + 3
        * c2_i158];
    }
  }

  for (c2_i160 = 0; c2_i160 < 3; c2_i160 = c2_i160 + 1) {
    for (c2_i161 = 0; c2_i161 < 3; c2_i161 = c2_i161 + 1) {
      c2_r_b[c2_i161 + 3 * c2_i160] = c2_Phi[c2_i160 + 3 * c2_i161];
    }
  }

  for (c2_i162 = 0; c2_i162 < 3; c2_i162 = c2_i162 + 1) {
    c2_fb_A[c2_i162] = c2_s_a[c2_i162];
  }

  for (c2_i163 = 0; c2_i163 < 9; c2_i163 = c2_i163 + 1) {
    c2_fb_B[c2_i163] = c2_r_b[c2_i163];
  }

  for (c2_i164 = 0; c2_i164 < 3; c2_i164 = c2_i164 + 1) {
    c2_gb_A[c2_i164] = c2_fb_A[c2_i164];
  }

  for (c2_i165 = 0; c2_i165 < 9; c2_i165 = c2_i165 + 1) {
    c2_gb_B[c2_i165] = c2_fb_B[c2_i165];
  }

  for (c2_i166 = 0; c2_i166 < 3; c2_i166 = c2_i166 + 1) {
    c2_hb_A[c2_i166] = c2_gb_A[c2_i166];
  }

  for (c2_i167 = 0; c2_i167 < 9; c2_i167 = c2_i167 + 1) {
    c2_hb_B[c2_i167] = c2_gb_B[c2_i167];
  }

  for (c2_i168 = 0; c2_i168 < 3; c2_i168 = c2_i168 + 1) {
    c2_bb_y[c2_i168] = 0.0;
    for (c2_i169 = 0; c2_i169 < 3; c2_i169 = c2_i169 + 1) {
      c2_bb_y[c2_i168] = c2_bb_y[c2_i168] + c2_hb_A[c2_i169] * c2_hb_B[c2_i169 +
        3 * c2_i168];
    }
  }

  for (c2_i170 = 0; c2_i170 < 3; c2_i170 = c2_i170 + 1) {
    c2_s_b[c2_i170] = c2_bb_y[c2_i170] + c2_ab_y[c2_i170];
  }

  for (c2_i171 = 0; c2_i171 < 3; c2_i171 = c2_i171 + 1) {
    for (c2_i172 = 0; c2_i172 < 3; c2_i172 = c2_i172 + 1) {
      c2_cb_y[c2_i172 + 3 * c2_i171] = c2_o_a[c2_i172] * c2_s_b[c2_i171];
    }
  }

  for (c2_i173 = 0; c2_i173 < 6; c2_i173 = c2_i173 + 1) {
    c2_t_a[c2_i173] = c2_G[c2_i173];
  }

  for (c2_i174 = 0; c2_i174 < 4; c2_i174 = c2_i174 + 1) {
    c2_t_b[c2_i174] = c2_Q[c2_i174];
  }

  for (c2_i175 = 0; c2_i175 < 6; c2_i175 = c2_i175 + 1) {
    c2_ib_A[c2_i175] = c2_t_a[c2_i175];
  }

  for (c2_i176 = 0; c2_i176 < 4; c2_i176 = c2_i176 + 1) {
    c2_ib_B[c2_i176] = c2_t_b[c2_i176];
  }

  for (c2_i177 = 0; c2_i177 < 6; c2_i177 = c2_i177 + 1) {
    c2_jb_A[c2_i177] = c2_ib_A[c2_i177];
  }

  for (c2_i178 = 0; c2_i178 < 4; c2_i178 = c2_i178 + 1) {
    c2_jb_B[c2_i178] = c2_ib_B[c2_i178];
  }

  for (c2_i179 = 0; c2_i179 < 6; c2_i179 = c2_i179 + 1) {
    c2_kb_A[c2_i179] = c2_jb_A[c2_i179];
  }

  for (c2_i180 = 0; c2_i180 < 4; c2_i180 = c2_i180 + 1) {
    c2_kb_B[c2_i180] = c2_jb_B[c2_i180];
  }

  for (c2_i181 = 0; c2_i181 < 3; c2_i181 = c2_i181 + 1) {
    for (c2_i182 = 0; c2_i182 < 2; c2_i182 = c2_i182 + 1) {
      c2_u_a[c2_i181 + 3 * c2_i182] = 0.0;
      for (c2_i183 = 0; c2_i183 < 2; c2_i183 = c2_i183 + 1) {
        c2_u_a[c2_i181 + 3 * c2_i182] = c2_u_a[c2_i181 + 3 * c2_i182] +
          c2_kb_A[c2_i181 + 3 * c2_i183] * c2_kb_B[c2_i183 + 2 * c2_i182];
      }
    }
  }

  for (c2_i184 = 0; c2_i184 < 3; c2_i184 = c2_i184 + 1) {
    for (c2_i185 = 0; c2_i185 < 2; c2_i185 = c2_i185 + 1) {
      c2_u_b[c2_i185 + 2 * c2_i184] = c2_G[c2_i184 + 3 * c2_i185];
    }
  }

  for (c2_i186 = 0; c2_i186 < 6; c2_i186 = c2_i186 + 1) {
    c2_lb_A[c2_i186] = c2_u_a[c2_i186];
  }

  for (c2_i187 = 0; c2_i187 < 6; c2_i187 = c2_i187 + 1) {
    c2_lb_B[c2_i187] = c2_u_b[c2_i187];
  }

  for (c2_i188 = 0; c2_i188 < 6; c2_i188 = c2_i188 + 1) {
    c2_mb_A[c2_i188] = c2_lb_A[c2_i188];
  }

  for (c2_i189 = 0; c2_i189 < 6; c2_i189 = c2_i189 + 1) {
    c2_mb_B[c2_i189] = c2_lb_B[c2_i189];
  }

  for (c2_i190 = 0; c2_i190 < 6; c2_i190 = c2_i190 + 1) {
    c2_nb_A[c2_i190] = c2_mb_A[c2_i190];
  }

  for (c2_i191 = 0; c2_i191 < 6; c2_i191 = c2_i191 + 1) {
    c2_nb_B[c2_i191] = c2_mb_B[c2_i191];
  }

  for (c2_i192 = 0; c2_i192 < 3; c2_i192 = c2_i192 + 1) {
    for (c2_i193 = 0; c2_i193 < 3; c2_i193 = c2_i193 + 1) {
      c2_db_y[c2_i192 + 3 * c2_i193] = 0.0;
      for (c2_i194 = 0; c2_i194 < 2; c2_i194 = c2_i194 + 1) {
        c2_db_y[c2_i192 + 3 * c2_i193] = c2_db_y[c2_i192 + 3 * c2_i193] +
          c2_nb_A[c2_i192 + 3 * c2_i194] * c2_nb_B[c2_i194 + 2 * c2_i193];
      }
    }
  }

  for (c2_i195 = 0; c2_i195 < 9; c2_i195 = c2_i195 + 1) {
    c2_v_a[c2_i195] = c2_Phi[c2_i195];
  }

  for (c2_i196 = 0; c2_i196 < 9; c2_i196 = c2_i196 + 1) {
    c2_v_b[c2_i196] = c2_Pk[c2_i196];
  }

  for (c2_i197 = 0; c2_i197 < 9; c2_i197 = c2_i197 + 1) {
    c2_ob_A[c2_i197] = c2_v_a[c2_i197];
  }

  for (c2_i198 = 0; c2_i198 < 9; c2_i198 = c2_i198 + 1) {
    c2_ob_B[c2_i198] = c2_v_b[c2_i198];
  }

  for (c2_i199 = 0; c2_i199 < 9; c2_i199 = c2_i199 + 1) {
    c2_pb_A[c2_i199] = c2_ob_A[c2_i199];
  }

  for (c2_i200 = 0; c2_i200 < 9; c2_i200 = c2_i200 + 1) {
    c2_pb_B[c2_i200] = c2_ob_B[c2_i200];
  }

  for (c2_i201 = 0; c2_i201 < 9; c2_i201 = c2_i201 + 1) {
    c2_qb_A[c2_i201] = c2_pb_A[c2_i201];
  }

  for (c2_i202 = 0; c2_i202 < 9; c2_i202 = c2_i202 + 1) {
    c2_qb_B[c2_i202] = c2_pb_B[c2_i202];
  }

  for (c2_i203 = 0; c2_i203 < 3; c2_i203 = c2_i203 + 1) {
    for (c2_i204 = 0; c2_i204 < 3; c2_i204 = c2_i204 + 1) {
      c2_w_a[c2_i203 + 3 * c2_i204] = 0.0;
      for (c2_i205 = 0; c2_i205 < 3; c2_i205 = c2_i205 + 1) {
        c2_w_a[c2_i203 + 3 * c2_i204] = c2_w_a[c2_i203 + 3 * c2_i204] +
          c2_qb_A[c2_i203 + 3 * c2_i205] * c2_qb_B[c2_i205 + 3 * c2_i204];
      }
    }
  }

  for (c2_i206 = 0; c2_i206 < 3; c2_i206 = c2_i206 + 1) {
    for (c2_i207 = 0; c2_i207 < 3; c2_i207 = c2_i207 + 1) {
      c2_w_b[c2_i207 + 3 * c2_i206] = c2_Phi[c2_i206 + 3 * c2_i207];
    }
  }

  for (c2_i208 = 0; c2_i208 < 9; c2_i208 = c2_i208 + 1) {
    c2_rb_A[c2_i208] = c2_w_a[c2_i208];
  }

  for (c2_i209 = 0; c2_i209 < 9; c2_i209 = c2_i209 + 1) {
    c2_rb_B[c2_i209] = c2_w_b[c2_i209];
  }

  for (c2_i210 = 0; c2_i210 < 9; c2_i210 = c2_i210 + 1) {
    c2_sb_A[c2_i210] = c2_rb_A[c2_i210];
  }

  for (c2_i211 = 0; c2_i211 < 9; c2_i211 = c2_i211 + 1) {
    c2_sb_B[c2_i211] = c2_rb_B[c2_i211];
  }

  for (c2_i212 = 0; c2_i212 < 9; c2_i212 = c2_i212 + 1) {
    c2_tb_A[c2_i212] = c2_sb_A[c2_i212];
  }

  for (c2_i213 = 0; c2_i213 < 9; c2_i213 = c2_i213 + 1) {
    c2_tb_B[c2_i213] = c2_sb_B[c2_i213];
  }

  for (c2_i214 = 0; c2_i214 < 3; c2_i214 = c2_i214 + 1) {
    for (c2_i215 = 0; c2_i215 < 3; c2_i215 = c2_i215 + 1) {
      c2_eb_y[c2_i214 + 3 * c2_i215] = 0.0;
      for (c2_i216 = 0; c2_i216 < 3; c2_i216 = c2_i216 + 1) {
        c2_eb_y[c2_i214 + 3 * c2_i215] = c2_eb_y[c2_i214 + 3 * c2_i215] +
          c2_tb_A[c2_i214 + 3 * c2_i216] * c2_tb_B[c2_i216 + 3 * c2_i215];
      }
    }
  }

  for (c2_i217 = 0; c2_i217 < 9; c2_i217 = c2_i217 + 1) {
    c2_Pkplus1[c2_i217] = (c2_eb_y[c2_i217] + c2_db_y[c2_i217]) -
      c2_cb_y[c2_i217];
  }

  _SFD_EML_CALL(0,-5);
  sf_debug_symbol_scope_pop();
  for (c2_i218 = 0; c2_i218 < 3; c2_i218 = c2_i218 + 1) {
    (*c2_b_xkplus1)[c2_i218] = c2_xkplus1[c2_i218];
  }

  for (c2_i219 = 0; c2_i219 < 9; c2_i219 = c2_i219 + 1) {
    (*c2_b_Pkplus1)[c2_i219] = c2_Pkplus1[c2_i219];
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,0);
}

static void init_script_number_translation(uint32_T c2_machineNumber, uint32_T
  c2_chartNumber)
{
}

static real_T c2_mpower(real_T c2_a)
{
  real_T c2_b_a;
  real_T c2_ak;
  c2_b_a = c2_a;
  c2_ak = c2_b_a;
  return muDoubleScalarPower(c2_ak, -1.0);
}

static const mxArray *c2_sf_marshall(void *c2_chartInstance, void *c2_u)
{
  const mxArray *c2_y = NULL;
  real_T c2_b_u;
  const mxArray *c2_b_y = NULL;
  c2_y = NULL;
  c2_b_u = *((real_T *)c2_u);
  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 0, 0U, 0U, 0U, 0));
  sf_mex_assign(&c2_y, c2_b_y);
  return c2_y;
}

static const mxArray *c2_b_sf_marshall(void *c2_chartInstance, void *c2_u)
{
  const mxArray *c2_y = NULL;
  int32_T c2_i220;
  int32_T c2_i221;
  real_T c2_b_u[9];
  const mxArray *c2_b_y = NULL;
  c2_y = NULL;
  for (c2_i220 = 0; c2_i220 < 3; c2_i220 = c2_i220 + 1) {
    for (c2_i221 = 0; c2_i221 < 3; c2_i221 = c2_i221 + 1) {
      c2_b_u[c2_i221 + 3 * c2_i220] = (*((real_T (*)[9])c2_u))[c2_i221 + 3 *
        c2_i220];
    }
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 0, 0U, 1U, 0U, 2, 3, 3));
  sf_mex_assign(&c2_y, c2_b_y);
  return c2_y;
}

static const mxArray *c2_c_sf_marshall(void *c2_chartInstance, void *c2_u)
{
  const mxArray *c2_y = NULL;
  int32_T c2_i222;
  real_T c2_b_u[3];
  const mxArray *c2_b_y = NULL;
  c2_y = NULL;
  for (c2_i222 = 0; c2_i222 < 3; c2_i222 = c2_i222 + 1) {
    c2_b_u[c2_i222] = (*((real_T (*)[3])c2_u))[c2_i222];
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 0, 0U, 1U, 0U, 1, 3));
  sf_mex_assign(&c2_y, c2_b_y);
  return c2_y;
}

static const mxArray *c2_d_sf_marshall(void *c2_chartInstance, void *c2_u)
{
  const mxArray *c2_y = NULL;
  int32_T c2_i223;
  int32_T c2_i224;
  real_T c2_b_u[6];
  const mxArray *c2_b_y = NULL;
  c2_y = NULL;
  for (c2_i223 = 0; c2_i223 < 2; c2_i223 = c2_i223 + 1) {
    for (c2_i224 = 0; c2_i224 < 3; c2_i224 = c2_i224 + 1) {
      c2_b_u[c2_i224 + 3 * c2_i223] = (*((real_T (*)[6])c2_u))[c2_i224 + 3 *
        c2_i223];
    }
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 0, 0U, 1U, 0U, 2, 3, 2));
  sf_mex_assign(&c2_y, c2_b_y);
  return c2_y;
}

static const mxArray *c2_e_sf_marshall(void *c2_chartInstance, void *c2_u)
{
  const mxArray *c2_y = NULL;
  int32_T c2_i225;
  real_T c2_b_u[3];
  const mxArray *c2_b_y = NULL;
  c2_y = NULL;
  for (c2_i225 = 0; c2_i225 < 3; c2_i225 = c2_i225 + 1) {
    c2_b_u[c2_i225] = (*((real_T (*)[3])c2_u))[c2_i225];
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 0, 0U, 1U, 0U, 2, 1, 3));
  sf_mex_assign(&c2_y, c2_b_y);
  return c2_y;
}

static const mxArray *c2_f_sf_marshall(void *c2_chartInstance, void *c2_u)
{
  const mxArray *c2_y = NULL;
  int32_T c2_i226;
  real_T c2_b_u[2];
  const mxArray *c2_b_y = NULL;
  c2_y = NULL;
  for (c2_i226 = 0; c2_i226 < 2; c2_i226 = c2_i226 + 1) {
    c2_b_u[c2_i226] = (*((real_T (*)[2])c2_u))[c2_i226];
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 0, 0U, 1U, 0U, 2, 1, 2));
  sf_mex_assign(&c2_y, c2_b_y);
  return c2_y;
}

static const mxArray *c2_g_sf_marshall(void *c2_chartInstance, void *c2_u)
{
  const mxArray *c2_y = NULL;
  int32_T c2_i227;
  int32_T c2_i228;
  real_T c2_b_u[4];
  const mxArray *c2_b_y = NULL;
  c2_y = NULL;
  for (c2_i227 = 0; c2_i227 < 2; c2_i227 = c2_i227 + 1) {
    for (c2_i228 = 0; c2_i228 < 2; c2_i228 = c2_i228 + 1) {
      c2_b_u[c2_i228 + 2 * c2_i227] = (*((real_T (*)[4])c2_u))[c2_i228 + 2 *
        c2_i227];
    }
  }

  c2_b_y = NULL;
  sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_b_u, 0, 0U, 1U, 0U, 2, 2, 2));
  sf_mex_assign(&c2_y, c2_b_y);
  return c2_y;
}

const mxArray *sf_c2_kalman4_get_eml_resolved_functions_info(void)
{
  const mxArray *c2_nameCaptureInfo = NULL;
  c2_ResolvedFunctionInfo c2_info[70];
  c2_ResolvedFunctionInfo (*c2_b_info)[70];
  const mxArray *c2_m0 = NULL;
  int32_T c2_i229;
  c2_ResolvedFunctionInfo *c2_r0;
  c2_nameCaptureInfo = NULL;
  c2_info_helper(c2_info);
  c2_b_info = (c2_ResolvedFunctionInfo (*)[70])c2_info;
  (*c2_b_info)[64].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isfinite.m";
  (*c2_b_info)[64].name = "isinf";
  (*c2_b_info)[64].dominantType = "double";
  (*c2_b_info)[64].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isinf.m";
  (*c2_b_info)[64].fileLength = 472U;
  (*c2_b_info)[64].fileTime1 = 1192466734U;
  (*c2_b_info)[64].fileTime2 = 0U;
  (*c2_b_info)[65].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_alloc.m";
  (*c2_b_info)[65].name = "eml_assert_valid_size_arg";
  (*c2_b_info)[65].dominantType = "int32";
  (*c2_b_info)[65].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m";
  (*c2_b_info)[65].fileLength = 2835U;
  (*c2_b_info)[65].fileTime1 = 1210870644U;
  (*c2_b_info)[65].fileTime2 = 0U;
  (*c2_b_info)[66].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xdot.m";
  (*c2_b_info)[66].name = "eml_blas_xdot";
  (*c2_b_info)[66].dominantType = "int32";
  (*c2_b_info)[66].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xdot.m";
  (*c2_b_info)[66].fileLength = 238U;
  (*c2_b_info)[66].fileTime1 = 1192466852U;
  (*c2_b_info)[66].fileTime2 = 0U;
  (*c2_b_info)[67].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_alloc.m/zerosum";
  (*c2_b_info)[67].name = "plus";
  (*c2_b_info)[67].dominantType = "double";
  (*c2_b_info)[67].resolved = "[B]plus";
  (*c2_b_info)[67].fileLength = 0U;
  (*c2_b_info)[67].fileTime1 = 0U;
  (*c2_b_info)[67].fileTime2 = 0U;
  (*c2_b_info)[68].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  (*c2_b_info)[68].name = "eml_xdotu";
  (*c2_b_info)[68].dominantType = "int32";
  (*c2_b_info)[68].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xdotu.m";
  (*c2_b_info)[68].fileLength = 1453U;
  (*c2_b_info)[68].fileTime1 = 1209330852U;
  (*c2_b_info)[68].fileTime2 = 0U;
  (*c2_b_info)[69].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  (*c2_b_info)[69].name = "nargin";
  (*c2_b_info)[69].dominantType = "";
  (*c2_b_info)[69].resolved = "[B]nargin";
  (*c2_b_info)[69].fileLength = 0U;
  (*c2_b_info)[69].fileTime1 = 0U;
  (*c2_b_info)[69].fileTime2 = 0U;
  sf_mex_assign(&c2_m0, sf_mex_createstruct("nameCaptureInfo", 1, 70));
  for (c2_i229 = 0; c2_i229 < 70; c2_i229 = c2_i229 + 1) {
    c2_r0 = &c2_info[c2_i229];
    sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", c2_r0->context, 15,
      0U, 0U, 0U, 2, 1, strlen(c2_r0->context)), "context",
                    "nameCaptureInfo", c2_i229);
    sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", c2_r0->name, 15, 0U,
      0U, 0U, 2, 1, strlen(c2_r0->name)), "name",
                    "nameCaptureInfo", c2_i229);
    sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", c2_r0->dominantType,
      15, 0U, 0U, 0U, 2, 1, strlen(c2_r0->dominantType)),
                    "dominantType", "nameCaptureInfo", c2_i229);
    sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", c2_r0->resolved, 15,
      0U, 0U, 0U, 2, 1, strlen(c2_r0->resolved)), "resolved"
                    , "nameCaptureInfo", c2_i229);
    sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", &c2_r0->fileLength,
      7, 0U, 0U, 0U, 0), "fileLength", "nameCaptureInfo",
                    c2_i229);
    sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", &c2_r0->fileTime1, 7,
      0U, 0U, 0U, 0), "fileTime1", "nameCaptureInfo",
                    c2_i229);
    sf_mex_addfield(c2_m0, sf_mex_create("nameCaptureInfo", &c2_r0->fileTime2, 7,
      0U, 0U, 0U, 0), "fileTime2", "nameCaptureInfo",
                    c2_i229);
  }

  sf_mex_assign(&c2_nameCaptureInfo, c2_m0);
  return c2_nameCaptureInfo;
}

static void c2_info_helper(c2_ResolvedFunctionInfo c2_info[70])
{
  c2_info[0].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[0].name = "gt";
  c2_info[0].dominantType = "double";
  c2_info[0].resolved = "[B]gt";
  c2_info[0].fileLength = 0U;
  c2_info[0].fileTime1 = 0U;
  c2_info[0].fileTime2 = 0U;
  c2_info[1].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c2_info[1].name = "eml_scalexp_size";
  c2_info[1].dominantType = "double";
  c2_info[1].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_size.m";
  c2_info[1].fileLength = 1373U;
  c2_info[1].fileTime1 = 1208180060U;
  c2_info[1].fileTime2 = 0U;
  c2_info[2].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/all.m";
  c2_info[2].name = "eml_all_or_any";
  c2_info[2].dominantType = "char";
  c2_info[2].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_all_or_any.m";
  c2_info[2].fileLength = 3423U;
  c2_info[2].fileTime1 = 1213637686U;
  c2_info[2].fileTime2 = 0U;
  c2_info[3].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[3].name = "isa";
  c2_info[3].dominantType = "double";
  c2_info[3].resolved = "[B]isa";
  c2_info[3].fileLength = 0U;
  c2_info[3].fileTime1 = 0U;
  c2_info[3].fileTime2 = 0U;
  c2_info[4].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[4].name = "size";
  c2_info[4].dominantType = "double";
  c2_info[4].resolved = "[B]size";
  c2_info[4].fileLength = 0U;
  c2_info[4].fileTime1 = 0U;
  c2_info[4].fileTime2 = 0U;
  c2_info[5].context = "";
  c2_info[5].name = "transpose";
  c2_info[5].dominantType = "double";
  c2_info[5].resolved = "[B]transpose";
  c2_info[5].fileLength = 0U;
  c2_info[5].fileTime1 = 0U;
  c2_info[5].fileTime2 = 0U;
  c2_info[6].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/datatypes/cast.m";
  c2_info[6].name = "int32";
  c2_info[6].dominantType = "double";
  c2_info[6].resolved = "[B]int32";
  c2_info[6].fileLength = 0U;
  c2_info[6].fileTime1 = 0U;
  c2_info[6].fileTime2 = 0U;
  c2_info[7].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[7].name = "eml_alloc";
  c2_info[7].dominantType = "int32";
  c2_info[7].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_alloc.m";
  c2_info[7].fileLength = 2627U;
  c2_info[7].fileTime1 = 1213637686U;
  c2_info[7].fileTime2 = 0U;
  c2_info[8].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m/isintegral";
  c2_info[8].name = "false";
  c2_info[8].dominantType = "";
  c2_info[8].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/false.m";
  c2_info[8].fileLength = 238U;
  c2_info[8].fileTime1 = 1192466720U;
  c2_info[8].fileTime2 = 0U;
  c2_info[9].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[9].name = "eq";
  c2_info[9].dominantType = "double";
  c2_info[9].resolved = "[B]eq";
  c2_info[9].fileLength = 0U;
  c2_info[9].fileTime1 = 0U;
  c2_info[9].fileTime2 = 0U;
  c2_info[10].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xgemm.m";
  c2_info[10].name = "eml_index_minus";
  c2_info[10].dominantType = "int32";
  c2_info[10].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_minus.m";
  c2_info[10].fileLength = 277U;
  c2_info[10].fileTime1 = 1192466784U;
  c2_info[10].fileTime2 = 0U;
  c2_info[11].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_size.m";
  c2_info[11].name = "eml_scalexp_compatible";
  c2_info[11].dominantType = "double";
  c2_info[11].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_compatible.m";
  c2_info[11].fileLength = 502U;
  c2_info[11].fileTime1 = 1208180058U;
  c2_info[11].fileTime2 = 0U;
  c2_info[12].context = "";
  c2_info[12].name = "mpower";
  c2_info[12].dominantType = "double";
  c2_info[12].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m";
  c2_info[12].fileLength = 3547U;
  c2_info[12].fileTime1 = 1213637688U;
  c2_info[12].fileTime2 = 0U;
  c2_info[13].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/lang/assert.m";
  c2_info[13].name = "not";
  c2_info[13].dominantType = "logical";
  c2_info[13].resolved = "[B]not";
  c2_info[13].fileLength = 0U;
  c2_info[13].fileTime1 = 0U;
  c2_info[13].fileTime2 = 0U;
  c2_info[14].context = "";
  c2_info[14].name = "ctranspose";
  c2_info[14].dominantType = "double";
  c2_info[14].resolved = "[B]ctranspose";
  c2_info[14].fileLength = 0U;
  c2_info[14].fileTime1 = 0U;
  c2_info[14].fileTime2 = 0U;
  c2_info[15].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_all_or_any.m";
  c2_info[15].name = "eml_set_singleton_dim";
  c2_info[15].dominantType = "double";
  c2_info[15].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_set_singleton_dim.m";
  c2_info[15].fileLength = 398U;
  c2_info[15].fileTime1 = 1209330838U;
  c2_info[15].fileTime2 = 0U;
  c2_info[16].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_isequal_core.m";
  c2_info[16].name = "minus";
  c2_info[16].dominantType = "double";
  c2_info[16].resolved = "[B]minus";
  c2_info[16].fileLength = 0U;
  c2_info[16].fileTime1 = 0U;
  c2_info[16].fileTime2 = 0U;
  c2_info[17].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[17].name = "strcmp";
  c2_info[17].dominantType = "char";
  c2_info[17].resolved = "[B]strcmp";
  c2_info[17].fileLength = 0U;
  c2_info[17].fileTime1 = 0U;
  c2_info[17].fileTime2 = 0U;
  c2_info[18].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/datatypes/cast.m";
  c2_info[18].name = "ge";
  c2_info[18].dominantType = "double";
  c2_info[18].resolved = "[B]ge";
  c2_info[18].fileLength = 0U;
  c2_info[18].fileTime1 = 0U;
  c2_info[18].fileTime2 = 0U;
  c2_info[19].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xgemm.m";
  c2_info[19].name = "eml_blas_xgemm";
  c2_info[19].dominantType = "int32";
  c2_info[19].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xgemm.m";
  c2_info[19].fileLength = 355U;
  c2_info[19].fileTime1 = 1192466854U;
  c2_info[19].fileTime2 = 0U;
  c2_info[20].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xgemm.m";
  c2_info[20].name = "eml_refblas_xgemm";
  c2_info[20].dominantType = "int32";
  c2_info[20].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xgemm.m";
  c2_info[20].fileLength = 5746U;
  c2_info[20].fileTime1 = 1210870658U;
  c2_info[20].fileTime2 = 0U;
  c2_info[21].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/all.m";
  c2_info[21].name = "lt";
  c2_info[21].dominantType = "double";
  c2_info[21].resolved = "[B]lt";
  c2_info[21].fileLength = 0U;
  c2_info[21].fileTime1 = 0U;
  c2_info[21].fileTime2 = 0U;
  c2_info[22].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[22].name = "cast";
  c2_info[22].dominantType = "double";
  c2_info[22].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/datatypes/cast.m";
  c2_info[22].fileLength = 866U;
  c2_info[22].fileTime1 = 1192466644U;
  c2_info[22].fileTime2 = 0U;
  c2_info[23].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m";
  c2_info[23].name = "intmax";
  c2_info[23].dominantType = "char";
  c2_info[23].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/intmax.m";
  c2_info[23].fileLength = 1535U;
  c2_info[23].fileTime1 = 1192466728U;
  c2_info[23].fileTime2 = 0U;
  c2_info[24].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_alloc.m";
  c2_info[24].name = "isstruct";
  c2_info[24].dominantType = "double";
  c2_info[24].resolved = "[B]isstruct";
  c2_info[24].fileLength = 0U;
  c2_info[24].fileTime1 = 0U;
  c2_info[24].fileTime2 = 0U;
  c2_info[25].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_alloc.m";
  c2_info[25].name = "zeros";
  c2_info[25].dominantType = "int32";
  c2_info[25].resolved = "[B]zeros";
  c2_info[25].fileLength = 0U;
  c2_info[25].fileTime1 = 0U;
  c2_info[25].fileTime2 = 0U;
  c2_info[26].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isequal.m";
  c2_info[26].name = "eml_isequal_core";
  c2_info[26].dominantType = "char";
  c2_info[26].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_isequal_core.m";
  c2_info[26].fileLength = 3543U;
  c2_info[26].fileTime1 = 1213637686U;
  c2_info[26].fileTime2 = 0U;
  c2_info[27].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[27].name = "eml_index_class";
  c2_info[27].dominantType = "";
  c2_info[27].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m";
  c2_info[27].fileLength = 909U;
  c2_info[27].fileTime1 = 1192466782U;
  c2_info[27].fileTime2 = 0U;
  c2_info[28].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xgemm.m";
  c2_info[28].name = "eml_index_plus";
  c2_info[28].dominantType = "int32";
  c2_info[28].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_plus.m";
  c2_info[28].fileLength = 272U;
  c2_info[28].fileTime1 = 1192466786U;
  c2_info[28].fileTime2 = 0U;
  c2_info[29].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[29].name = "le";
  c2_info[29].dominantType = "double";
  c2_info[29].resolved = "[B]le";
  c2_info[29].fileLength = 0U;
  c2_info[29].fileTime1 = 0U;
  c2_info[29].fileTime2 = 0U;
  c2_info[30].context = "";
  c2_info[30].name = "mtimes";
  c2_info[30].dominantType = "double";
  c2_info[30].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[30].fileLength = 2336U;
  c2_info[30].fileTime1 = 1213637690U;
  c2_info[30].fileTime2 = 0U;
  c2_info[31].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xdot.m";
  c2_info[31].name = "eml_refblas_xdotx";
  c2_info[31].dominantType = "int32";
  c2_info[31].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xdotx.m";
  c2_info[31].fileLength = 1786U;
  c2_info[31].fileTime1 = 1210870656U;
  c2_info[31].fileTime2 = 0U;
  c2_info[32].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m/numel_for_size";
  c2_info[32].name = "double";
  c2_info[32].dominantType = "int32";
  c2_info[32].resolved = "[B]double";
  c2_info[32].fileLength = 0U;
  c2_info[32].fileTime1 = 0U;
  c2_info[32].fileTime2 = 0U;
  c2_info[33].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[33].name = "class";
  c2_info[33].dominantType = "double";
  c2_info[33].resolved = "[B]class";
  c2_info[33].fileLength = 0U;
  c2_info[33].fileTime1 = 0U;
  c2_info[33].fileTime2 = 0U;
  c2_info[34].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/datatypes/cast.m";
  c2_info[34].name = "ischar";
  c2_info[34].dominantType = "char";
  c2_info[34].resolved = "[B]ischar";
  c2_info[34].fileLength = 0U;
  c2_info[34].fileTime1 = 0U;
  c2_info[34].fileTime2 = 0U;
  c2_info[35].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[35].name = "isreal";
  c2_info[35].dominantType = "double";
  c2_info[35].resolved = "[B]isreal";
  c2_info[35].fileLength = 0U;
  c2_info[35].fileTime1 = 0U;
  c2_info[35].fileTime2 = 0U;
  c2_info[36].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xdotu.m";
  c2_info[36].name = "eml_xdot";
  c2_info[36].dominantType = "int32";
  c2_info[36].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xdot.m";
  c2_info[36].fileLength = 1330U;
  c2_info[36].fileTime1 = 1209330850U;
  c2_info[36].fileTime2 = 0U;
  c2_info[37].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c2_info[37].name = "eml_error";
  c2_info[37].dominantType = "char";
  c2_info[37].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_error.m";
  c2_info[37].fileLength = 315U;
  c2_info[37].fileTime1 = 1213637686U;
  c2_info[37].fileTime2 = 0U;
  c2_info[38].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xdotx.m";
  c2_info[38].name = "isequal";
  c2_info[38].dominantType = "char";
  c2_info[38].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isequal.m";
  c2_info[38].fileLength = 157U;
  c2_info[38].fileTime1 = 1210870646U;
  c2_info[38].fileTime2 = 0U;
  c2_info[39].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/true.m";
  c2_info[39].name = "logical";
  c2_info[39].dominantType = "double";
  c2_info[39].resolved = "[B]logical";
  c2_info[39].fileLength = 0U;
  c2_info[39].fileTime1 = 0U;
  c2_info[39].fileTime2 = 0U;
  c2_info[40].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[40].name = "isempty";
  c2_info[40].dominantType = "double";
  c2_info[40].resolved = "[B]isempty";
  c2_info[40].fileLength = 0U;
  c2_info[40].fileTime1 = 0U;
  c2_info[40].fileTime2 = 0U;
  c2_info[41].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/internal/eml_blas_xdot.m";
  c2_info[41].name = "eml_refblas_xdot";
  c2_info[41].dominantType = "int32";
  c2_info[41].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xdot.m";
  c2_info[41].fileLength = 343U;
  c2_info[41].fileTime1 = 1210870656U;
  c2_info[41].fileTime2 = 0U;
  c2_info[42].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[42].name = "ones";
  c2_info[42].dominantType = "char";
  c2_info[42].resolved = "[B]ones";
  c2_info[42].fileLength = 0U;
  c2_info[42].fileTime1 = 0U;
  c2_info[42].fileTime2 = 0U;
  c2_info[43].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_isequal_core.m/binary_isequal";
  c2_info[43].name = "all";
  c2_info[43].dominantType = "logical";
  c2_info[43].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/all.m";
  c2_info[43].fileLength = 400U;
  c2_info[43].fileTime1 = 1192466904U;
  c2_info[43].fileTime2 = 0U;
  c2_info[44].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[44].name = "isinteger";
  c2_info[44].dominantType = "double";
  c2_info[44].resolved = "[B]isinteger";
  c2_info[44].fileLength = 0U;
  c2_info[44].fileTime1 = 0U;
  c2_info[44].fileTime2 = 0U;
  c2_info[45].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c2_info[45].name = "eml_scalar_floor";
  c2_info[45].dominantType = "double";
  c2_info[45].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_floor.m";
  c2_info[45].fileLength = 260U;
  c2_info[45].fileTime1 = 1209330790U;
  c2_info[45].fileTime2 = 0U;
  c2_info[46].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[46].name = "assert";
  c2_info[46].dominantType = "char";
  c2_info[46].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/lang/assert.m";
  c2_info[46].fileLength = 2684U;
  c2_info[46].fileTime1 = 1210870656U;
  c2_info[46].fileTime2 = 0U;
  c2_info[47].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xdotx.m";
  c2_info[47].name = "uminus";
  c2_info[47].dominantType = "int32";
  c2_info[47].resolved = "[B]uminus";
  c2_info[47].fileLength = 0U;
  c2_info[47].fileTime1 = 0U;
  c2_info[47].fileTime2 = 0U;
  c2_info[48].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[48].name = "isscalar";
  c2_info[48].dominantType = "double";
  c2_info[48].resolved = "[B]isscalar";
  c2_info[48].fileLength = 0U;
  c2_info[48].fileTime1 = 0U;
  c2_info[48].fileTime2 = 0U;
  c2_info[49].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m/isintegral";
  c2_info[49].name = "true";
  c2_info[49].dominantType = "";
  c2_info[49].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/true.m";
  c2_info[49].fileLength = 237U;
  c2_info[49].fileTime1 = 1192466762U;
  c2_info[49].fileTime2 = 0U;
  c2_info[50].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[50].name = "ne";
  c2_info[50].dominantType = "logical";
  c2_info[50].resolved = "[B]ne";
  c2_info[50].fileLength = 0U;
  c2_info[50].fileTime1 = 0U;
  c2_info[50].fileTime2 = 0U;
  c2_info[51].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[51].name = "ndims";
  c2_info[51].dominantType = "double";
  c2_info[51].resolved = "[B]ndims";
  c2_info[51].fileLength = 0U;
  c2_info[51].fileTime1 = 0U;
  c2_info[51].fileTime2 = 0U;
  c2_info[52].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_all_or_any.m";
  c2_info[52].name = "eml_nonsingleton_dim";
  c2_info[52].dominantType = "logical";
  c2_info[52].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_nonsingleton_dim.m";
  c2_info[52].fileLength = 404U;
  c2_info[52].fileTime1 = 1192466800U;
  c2_info[52].fileTime2 = 0U;
  c2_info[53].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m";
  c2_info[53].name = "isnumeric";
  c2_info[53].dominantType = "int32";
  c2_info[53].resolved = "[B]isnumeric";
  c2_info[53].fileLength = 0U;
  c2_info[53].fileTime1 = 0U;
  c2_info[53].fileTime2 = 0U;
  c2_info[54].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[54].name = "eml_zeros";
  c2_info[54].dominantType = "double";
  c2_info[54].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_zeros.m";
  c2_info[54].fileLength = 1083U;
  c2_info[54].fileTime1 = 1213637688U;
  c2_info[54].fileTime2 = 0U;
  c2_info[55].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xdotx.m";
  c2_info[55].name = "times";
  c2_info[55].dominantType = "double";
  c2_info[55].resolved = "[B]times";
  c2_info[55].fileLength = 0U;
  c2_info[55].fileTime1 = 0U;
  c2_info[55].fileTime2 = 0U;
  c2_info[56].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m/isintegral";
  c2_info[56].name = "isfinite";
  c2_info[56].dominantType = "double";
  c2_info[56].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isfinite.m";
  c2_info[56].fileLength = 341U;
  c2_info[56].fileTime1 = 1192466734U;
  c2_info[56].fileTime2 = 0U;
  c2_info[57].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m";
  c2_info[57].name = "power";
  c2_info[57].dominantType = "double";
  c2_info[57].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c2_info[57].fileLength = 5131U;
  c2_info[57].fileTime1 = 1213637690U;
  c2_info[57].fileTime2 = 0U;
  c2_info[58].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/lang/assert.m";
  c2_info[58].name = "islogical";
  c2_info[58].dominantType = "logical";
  c2_info[58].resolved = "[B]islogical";
  c2_info[58].fileLength = 0U;
  c2_info[58].fileTime1 = 0U;
  c2_info[58].fileTime2 = 0U;
  c2_info[59].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_assert_valid_size_arg.m";
  c2_info[59].name = "isvector";
  c2_info[59].dominantType = "int32";
  c2_info[59].resolved = "[B]isvector";
  c2_info[59].fileLength = 0U;
  c2_info[59].fileTime1 = 0U;
  c2_info[59].fileTime2 = 0U;
  c2_info[60].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xgemm.m";
  c2_info[60].name = "eml_index_times";
  c2_info[60].dominantType = "int32";
  c2_info[60].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_times.m";
  c2_info[60].fileLength = 280U;
  c2_info[60].fileTime1 = 1192466788U;
  c2_info[60].fileTime2 = 0U;
  c2_info[61].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isfinite.m";
  c2_info[61].name = "and";
  c2_info[61].dominantType = "logical";
  c2_info[61].resolved = "[B]and";
  c2_info[61].fileLength = 0U;
  c2_info[61].fileTime1 = 0U;
  c2_info[61].fileTime2 = 0U;
  c2_info[62].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c2_info[62].name = "eml_xgemm";
  c2_info[62].dominantType = "int32";
  c2_info[62].resolved =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xgemm.m";
  c2_info[62].fileLength = 3184U;
  c2_info[62].fileTime1 = 1209330852U;
  c2_info[62].fileTime2 = 0U;
  c2_info[63].context =
    "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isfinite.m";
  c2_info[63].name = "isnan";
  c2_info[63].dominantType = "double";
  c2_info[63].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isnan.m";
  c2_info[63].fileLength = 472U;
  c2_info[63].fileTime1 = 1192466736U;
  c2_info[63].fileTime2 = 0U;
}

static void init_dsm_address_info(void)
{
}

/* SFunction Glue Code */
void sf_c2_kalman4_get_check_sum(mxArray *plhs[])
{
  ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(195993555U);
  ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(1306798029U);
  ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(1864608584U);
  ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(444477869U);
}

mxArray *sf_c2_kalman4_get_autoinheritance_info(void)
{
  const char *autoinheritanceFields[] = { "checksum", "inputs", "parameters",
    "outputs" };

  mxArray *mxAutoinheritanceInfo = mxCreateStructMatrix(1,1,4,
    autoinheritanceFields);

  {
    mxArray *mxChecksum = mxCreateDoubleMatrix(4,1,mxREAL);
    double *pr = mxGetPr(mxChecksum);
    pr[0] = (double)(3506456847U);
    pr[1] = (double)(1031120831U);
    pr[2] = (double)(2576231697U);
    pr[3] = (double)(482695473U);
    mxSetField(mxAutoinheritanceInfo,0,"checksum",mxChecksum);
  }

  {
    const char *dataFields[] = { "size", "type", "complexity" };

    mxArray *mxData = mxCreateStructMatrix(1,12,3,dataFields);

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,0,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,0,"type",mxType);
    }

    mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(3);
      mxSetField(mxData,1,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,1,"type",mxType);
    }

    mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(1);
      mxSetField(mxData,2,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,2,"type",mxType);
    }

    mxSetField(mxData,2,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(2);
      mxSetField(mxData,3,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,3,"type",mxType);
    }

    mxSetField(mxData,3,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(3);
      mxSetField(mxData,4,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,4,"type",mxType);
    }

    mxSetField(mxData,4,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,5,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,5,"type",mxType);
    }

    mxSetField(mxData,5,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(2);
      mxSetField(mxData,6,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,6,"type",mxType);
    }

    mxSetField(mxData,6,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(2);
      pr[1] = (double)(2);
      mxSetField(mxData,7,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,7,"type",mxType);
    }

    mxSetField(mxData,7,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,8,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,8,"type",mxType);
    }

    mxSetField(mxData,8,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(1);
      mxSetField(mxData,9,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,9,"type",mxType);
    }

    mxSetField(mxData,9,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(3);
      mxSetField(mxData,10,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,10,"type",mxType);
    }

    mxSetField(mxData,10,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,11,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,11,"type",mxType);
    }

    mxSetField(mxData,11,"complexity",mxCreateDoubleScalar(0));
    mxSetField(mxAutoinheritanceInfo,0,"inputs",mxData);
  }

  {
    mxSetField(mxAutoinheritanceInfo,0,"parameters",mxCreateDoubleMatrix(0,0,
                mxREAL));
  }

  {
    const char *dataFields[] = { "size", "type", "complexity" };

    mxArray *mxData = mxCreateStructMatrix(1,2,3,dataFields);

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(1);
      mxSetField(mxData,0,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,0,"type",mxType);
    }

    mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(3);
      pr[1] = (double)(3);
      mxSetField(mxData,1,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,1,"type",mxType);
    }

    mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0));
    mxSetField(mxAutoinheritanceInfo,0,"outputs",mxData);
  }

  return(mxAutoinheritanceInfo);
}

static void chart_debug_initialization(SimStruct *S, unsigned int
  fullDebuggerInitialization)
{
  if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) {
    /* do this only if simulation is starting */
    if (!sim_mode_is_rtw_gen(S)) {
      {
        unsigned int chartAlreadyPresent;
        chartAlreadyPresent = sf_debug_initialize_chart(_kalman4MachineNumber_,
          2,
          1,
          1,
          14,
          0,
          0,
          0,
          0,
          0,
          &(chartInstance.chartNumber),
          &(chartInstance.instanceNumber),
          ssGetPath(S),
          (void *)S);
        if (chartAlreadyPresent==0) {
          /* this is the first instance */
          init_script_number_translation(_kalman4MachineNumber_,
            chartInstance.chartNumber);
          sf_debug_set_chart_disable_implicit_casting(_kalman4MachineNumber_,
            chartInstance.chartNumber,1);
          sf_debug_set_chart_event_thresholds(_kalman4MachineNumber_,
            chartInstance.chartNumber,
            0,
            0,
            0);
          _SFD_SET_DATA_PROPS(0,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"u",0,
                              c2_sf_marshall);

          {
            unsigned int dimVector[1];
            dimVector[0]= 3;
            _SFD_SET_DATA_PROPS(1,2,0,1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"xkplus1",0,NULL);
          }

          {
            unsigned int dimVector[2];
            dimVector[0]= 3;
            dimVector[1]= 3;
            _SFD_SET_DATA_PROPS(2,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"Phi",0,c2_b_sf_marshall);
          }

          {
            unsigned int dimVector[2];
            dimVector[0]= 3;
            dimVector[1]= 1;
            _SFD_SET_DATA_PROPS(3,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"Gamma",0,c2_c_sf_marshall);
          }

          {
            unsigned int dimVector[2];
            dimVector[0]= 3;
            dimVector[1]= 2;
            _SFD_SET_DATA_PROPS(4,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"G",0,c2_d_sf_marshall);
          }

          {
            unsigned int dimVector[2];
            dimVector[0]= 1;
            dimVector[1]= 3;
            _SFD_SET_DATA_PROPS(5,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"C",0,c2_e_sf_marshall);
          }

          _SFD_SET_DATA_PROPS(6,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"D",0,
                              NULL);

          {
            unsigned int dimVector[2];
            dimVector[0]= 1;
            dimVector[1]= 2;
            _SFD_SET_DATA_PROPS(7,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"H",0,c2_f_sf_marshall);
          }

          {
            unsigned int dimVector[2];
            dimVector[0]= 2;
            dimVector[1]= 2;
            _SFD_SET_DATA_PROPS(8,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"Q",0,c2_g_sf_marshall);
          }

          _SFD_SET_DATA_PROPS(9,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"R",0,
                              NULL);

          {
            unsigned int dimVector[1];
            dimVector[0]= 3;
            _SFD_SET_DATA_PROPS(10,1,1,0,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"xk",0,NULL);
          }

          {
            unsigned int dimVector[2];
            dimVector[0]= 3;
            dimVector[1]= 3;
            _SFD_SET_DATA_PROPS(11,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"Pk",0,NULL);
          }

          {
            unsigned int dimVector[2];
            dimVector[0]= 3;
            dimVector[1]= 3;
            _SFD_SET_DATA_PROPS(12,2,0,1,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
                                1.0,0,"Pkplus1",0,NULL);
          }

          _SFD_SET_DATA_PROPS(13,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"y",0,
                              NULL);
          _SFD_STATE_INFO(0,0,2);
          _SFD_CH_SUBSTATE_COUNT(0);
          _SFD_CH_SUBSTATE_DECOMP(0);
        }

        _SFD_CV_INIT_CHART(0,0,0,0);

        {
          _SFD_CV_INIT_STATE(0,0,0,0,0,0,NULL,NULL);
        }

        _SFD_CV_INIT_TRANS(0,0,NULL,NULL,0,NULL);

        /* Initialization of EML Model Coverage */
        _SFD_CV_INIT_EML(0,1,0,0,0,0,0,0);
        _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,233);
        _SFD_TRANS_COV_WTS(0,0,0,1,0);
        if (chartAlreadyPresent==0) {
          _SFD_TRANS_COV_MAPS(0,
                              0,NULL,NULL,
                              0,NULL,NULL,
                              1,NULL,NULL,
                              0,NULL,NULL);
        }

        {
          real_T *c2_u;
          real_T (*c2_xkplus1)[3];
          real_T (*c2_Phi)[9];
          real_T (*c2_Gamma)[3];
          real_T (*c2_G)[6];
          real_T (*c2_C)[3];
          real_T *c2_D;
          real_T (*c2_H)[2];
          real_T (*c2_Q)[4];
          real_T *c2_R;
          real_T (*c2_xk)[3];
          real_T (*c2_Pk)[9];
          real_T (*c2_Pkplus1)[9];
          real_T *c2_y;
          c2_H = (real_T (*)[2])ssGetInputPortSignal(chartInstance.S, 6);
          c2_xkplus1 = (real_T (*)[3])ssGetOutputPortSignal(chartInstance.S, 1);
          c2_Q = (real_T (*)[4])ssGetInputPortSignal(chartInstance.S, 7);
          c2_D = (real_T *)ssGetInputPortSignal(chartInstance.S, 5);
          c2_y = (real_T *)ssGetInputPortSignal(chartInstance.S, 11);
          c2_Phi = (real_T (*)[9])ssGetInputPortSignal(chartInstance.S, 1);
          c2_u = (real_T *)ssGetInputPortSignal(chartInstance.S, 0);
          c2_G = (real_T (*)[6])ssGetInputPortSignal(chartInstance.S, 3);
          c2_xk = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 9);
          c2_Pk = (real_T (*)[9])ssGetInputPortSignal(chartInstance.S, 10);
          c2_Gamma = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 2);
          c2_R = (real_T *)ssGetInputPortSignal(chartInstance.S, 8);
          c2_C = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 4);
          c2_Pkplus1 = (real_T (*)[9])ssGetOutputPortSignal(chartInstance.S, 2);
          _SFD_SET_DATA_VALUE_PTR(0U, c2_u);
          _SFD_SET_DATA_VALUE_PTR(1U, c2_xkplus1);
          _SFD_SET_DATA_VALUE_PTR(2U, c2_Phi);
          _SFD_SET_DATA_VALUE_PTR(3U, c2_Gamma);
          _SFD_SET_DATA_VALUE_PTR(4U, c2_G);
          _SFD_SET_DATA_VALUE_PTR(5U, c2_C);
          _SFD_SET_DATA_VALUE_PTR(6U, c2_D);
          _SFD_SET_DATA_VALUE_PTR(7U, c2_H);
          _SFD_SET_DATA_VALUE_PTR(8U, c2_Q);
          _SFD_SET_DATA_VALUE_PTR(9U, c2_R);
          _SFD_SET_DATA_VALUE_PTR(10U, c2_xk);
          _SFD_SET_DATA_VALUE_PTR(11U, c2_Pk);
          _SFD_SET_DATA_VALUE_PTR(12U, c2_Pkplus1);
          _SFD_SET_DATA_VALUE_PTR(13U, c2_y);
        }
      }
    }
  } else {
    sf_debug_reset_current_state_configuration(_kalman4MachineNumber_,
      chartInstance.chartNumber,chartInstance.instanceNumber);
  }
}

static void sf_opaque_initialize_c2_kalman4(void *chartInstanceVar)
{
  chart_debug_initialization(chartInstance.S,0);
  initialize_params_c2_kalman4();
  initialize_c2_kalman4();
}

static void sf_opaque_enable_c2_kalman4(void *chartInstanceVar)
{
  enable_c2_kalman4();
}

static void sf_opaque_disable_c2_kalman4(void *chartInstanceVar)
{
  disable_c2_kalman4();
}

static void sf_opaque_gateway_c2_kalman4(void *chartInstanceVar)
{
  sf_c2_kalman4();
}

static mxArray* sf_opaque_get_sim_state_c2_kalman4(void *chartInstanceVar)
{
  mxArray *st = (mxArray *) get_sim_state_c2_kalman4();
  return st;
}

static void sf_opaque_set_sim_state_c2_kalman4(void *chartInstanceVar, const
  mxArray *st)
{
  set_sim_state_c2_kalman4(sf_mex_dup(st));
}

static void sf_opaque_terminate_c2_kalman4(void *chartInstanceVar)
{
  if (sim_mode_is_rtw_gen(chartInstance.S) || sim_mode_is_external
      (chartInstance.S)) {
    sf_clear_rtw_identifier(chartInstance.S);
  }

  finalize_c2_kalman4();
}

extern unsigned int sf_machine_global_initializer_called(void);
static void mdlProcessParameters_c2_kalman4(SimStruct *S)
{
  int i;
  for (i=0;i<ssGetNumRunTimeParams(S);i++) {
    if (ssGetSFcnParamTunable(S,i)) {
      ssUpdateDlgParamAsRunTimeParam(S,i);
    }
  }

  if (sf_machine_global_initializer_called()) {
    initialize_params_c2_kalman4();
  }
}

static void mdlSetWorkWidths_c2_kalman4(SimStruct *S)
{
  if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) {
    int_T chartIsInlinable =
      (int_T)sf_is_chart_inlinable("kalman4","kalman4",2);
    ssSetStateflowIsInlinable(S,chartIsInlinable);
    ssSetRTWCG(S,sf_rtw_info_uint_prop("kalman4","kalman4",2,"RTWCG"));
    ssSetEnableFcnIsTrivial(S,1);
    ssSetDisableFcnIsTrivial(S,1);
    ssSetNotMultipleInlinable(S,sf_rtw_info_uint_prop("kalman4","kalman4",2,
      "gatewayCannotBeInlinedMultipleTimes"));
    if (chartIsInlinable) {
      ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 1, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 2, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 3, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 4, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 5, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 6, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 7, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 8, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 9, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 10, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 11, SS_REUSABLE_AND_LOCAL);
      sf_mark_chart_expressionable_inputs(S,"kalman4","kalman4",2,12);
      sf_mark_chart_reusable_outputs(S,"kalman4","kalman4",2,2);
    }

    sf_set_rtw_dwork_info(S,"kalman4","kalman4",2);
    ssSetHasSubFunctions(S,!(chartIsInlinable));
    ssSetOptions(S,ssGetOptions(S)|SS_OPTION_WORKS_WITH_CODE_REUSE);
  }

  ssSetChecksum0(S,(3145700011U));
  ssSetChecksum1(S,(2838929126U));
  ssSetChecksum2(S,(95978413U));
  ssSetChecksum3(S,(2255656857U));
  ssSetmdlDerivatives(S, NULL);
  ssSetExplicitFCSSCtrl(S,1);
}

static void mdlRTW_c2_kalman4(SimStruct *S)
{
  if (sim_mode_is_rtw_gen(S)) {
    sf_write_symbol_mapping(S, "kalman4", "kalman4",2);
    ssWriteRTWStrParam(S, "StateflowChartType", "Embedded MATLAB");
  }
}

static void mdlStart_c2_kalman4(SimStruct *S)
{
  chartInstance.chartInfo.chartInstance = NULL;
  chartInstance.chartInfo.isEMLChart = 1;
  chartInstance.chartInfo.chartInitialized = 0;
  chartInstance.chartInfo.sFunctionGateway = sf_opaque_gateway_c2_kalman4;
  chartInstance.chartInfo.initializeChart = sf_opaque_initialize_c2_kalman4;
  chartInstance.chartInfo.terminateChart = sf_opaque_terminate_c2_kalman4;
  chartInstance.chartInfo.enableChart = sf_opaque_enable_c2_kalman4;
  chartInstance.chartInfo.disableChart = sf_opaque_disable_c2_kalman4;
  chartInstance.chartInfo.getSimState = sf_opaque_get_sim_state_c2_kalman4;
  chartInstance.chartInfo.setSimState = sf_opaque_set_sim_state_c2_kalman4;
  chartInstance.chartInfo.zeroCrossings = NULL;
  chartInstance.chartInfo.outputs = NULL;
  chartInstance.chartInfo.derivatives = NULL;
  chartInstance.chartInfo.mdlRTW = mdlRTW_c2_kalman4;
  chartInstance.chartInfo.mdlStart = mdlStart_c2_kalman4;
  chartInstance.chartInfo.mdlSetWorkWidths = mdlSetWorkWidths_c2_kalman4;
  chartInstance.chartInfo.extModeExec = NULL;
  chartInstance.chartInfo.restoreLastMajorStepConfiguration = NULL;
  chartInstance.chartInfo.restoreBeforeLastMajorStepConfiguration = NULL;
  chartInstance.chartInfo.storeCurrentConfiguration = NULL;
  chartInstance.S = S;
  ssSetUserData(S,(void *)(&(chartInstance.chartInfo)));/* register the chart instance with simstruct */
  if (!sim_mode_is_rtw_gen(S)) {
    init_dsm_address_info();
  }

  chart_debug_initialization(S,1);
}

void c2_kalman4_method_dispatcher(SimStruct *S, int_T method, void *data)
{
  switch (method) {
   case SS_CALL_MDL_START:
    mdlStart_c2_kalman4(S);
    break;

   case SS_CALL_MDL_SET_WORK_WIDTHS:
    mdlSetWorkWidths_c2_kalman4(S);
    break;

   case SS_CALL_MDL_PROCESS_PARAMETERS:
    mdlProcessParameters_c2_kalman4(S);
    break;

   default:
    /* Unhandled method */
    sf_mex_error_message("Stateflow Internal Error:\n"
                         "Error calling c2_kalman4_method_dispatcher.\n"
                         "Can't handle method %d.\n", method);
    break;
  }
}
